Note: This article was originally written for Human Readable magazine in May 2020. That site no longer exists, so I decided to republish it on this blog. 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 ...