Hacking on the compiler

Hello everybody. I am interested in learning how the OCaml compiler works, and hacking on it in places. I am a GNU Emacs user and am having a hard time getting merlin to recognize several modules from the /utils directory such as clflags. I think the resolution here is to have a .merlin file, but I do not know how to generate one from a project using a makefile structure. Any advice would be appreciated. Thank you.

2 Likes

.merlin files are easy to create by hand. Just read the docs. Three or four lines and you’ll probably have most of what you want. The syntax is very simple.

Last time I tried, using the Dune build system did help a great deal with this.

For that, in a clean OCaml tree run:

./configure
dune build @world

This is pretty experimental tho so YMMV.

2 Likes

Thank you @ejgallego that worked well!