Introduction to OCaml Extension Points - citizen428.net

Metaprogramming is a technique in which programs modify themselves at compile or run time. This can be achieved in various ways, for example through reflection (C#, Java, Ruby, Smalltalk), templates (C++, D, Template Haskell), or macros (Lisp, Elixir). The OCaml language offers a distinct approach to compile-time code generation in the form of extension points and AST rewriters, which we’ll explore in this article.