[ANN] Areas and Adversaries

I figured people might be bored of British pub names by now so I did another thing: a generator for titles of table-top role-playing games.

$ opam install areas-and-adversaries
...
$ areas-and-adversaries
Woods & Wizards

The code is on Gitlab: Raphaël Proust / areas-and-adversaries · GitLab

It was a good excuse to experiment with non-dune build systems (to scope things out). I went for a plain Makefile in the end which works well.

I also wanted to figure out a better way to embed data in an executable. I ended up wondering about moving as much of the processing as possible into the build phase. What I ended up with is a small program which prints a compilation unit (.ml) which has mostly array literals. Still have some open questions on that, any input welcome:

  • Should I have used meta-ocaml to print the code? The data/munch.ml would probably be more readable, but the build probably less.
  • How could I generate this kind of processed-data code for data-structures which don’t have a literal (maps, sets, hash tables, etc.)? How can I minimise the initialisation cost of the program for such situations?
8 Likes