Language Feature

Metaprogramming in OCaml: Extension Points and PPX

Illustrated by Julia Hanke

Extension points and AST rewriters are the OCaml answer to metaprogramming. You'll feel at ease diving right in to developing rewriters using OCaml PreProcessor eXtensions (PPX). Get your feet wet by writing a simple extension that replaces a string with its uppercase version. Then dive deeper by building an expander. Finally, explore some existing extension points and popular libraries that showcase the flexibility and power of PPX.

To continue reading


  • Access to original high quality content
  • Priority support and feedback
  • A thank you for supporting our small independant publication

Already purchased issue? Login