OCaml version of the "Build systems à la carte" paper

There is a great paper distilling several different build systems (Make, Excel, Bazel, etc.) into a unified framework. One of its authors is on the Dune team (I think). If you want to understand or write build systems, it is a good read because it uses language that can be understood by non-academics:

All of its examples are in Haskell so I wrote a version in OCaml. Most of my OCaml translation was aided by the English paragraphs rather than the Haskell code (the latter was hieroglyphics to me). Regardless, I’m fairly sure some of the concepts don’t translate to OCaml well.

If you are interested in build systems, the first place to start is the test directory tests/MlFront_Thunk · V2_4 · DkML / Build Tools / MlFront · GitLab (the alacarte_*.ml modules). The tests correspond to the paper’s section numbers, although there are also alacarte_x*.ml tests where I extended the framework. Then you can scan the source code at src/MlFront_Thunk · V2_4 · DkML / Build Tools / MlFront · GitLab (the Build*.ml and Promise.ml modules).

PRs welcome!

18 Likes