At Jane Street, we have always been heavy users of pre-processors, first with camlp4 and now ppx. Pre-processing makes the infrastructure a bit more complex, but it save us a lot of time by taking care of a lot of tedious boilerplate code and in some case makes the code a bit prettier.
All in all, our standard set has 19 rewriters:
These rewriters fall into 3 big categories:
- type driven code generators: ppx_sexp_conv, ppx_bin_prot, …
- inline tests and benchmarks: ppx_inline_test, ppx_expect, ppx_bench
- convenience: ppx_sexp_value, ppx_custom_printf, …
The first category is the one that definitely justify the use of pre-processors, until we get something better in the language itself.