# Hacking on the compiler

**URL:** <https://discuss.ocaml.org/t/hacking-on-the-compiler/4236>\
**Category:** Learning\
**Created:** [August 9, 2019, 11:25pm UTC](https://discuss.ocaml.org/t/hacking-on-the-compiler/4236 "2019-08-09T23:25:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brettgilio](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/brettgilio/32/1933_2.png) [@brettgilio](https://discuss.ocaml.org/u/brettgilio)\
**Post date:** [August 9, 2019, 11:25pm UTC](https://discuss.ocaml.org/t/hacking-on-the-compiler/4236/1 "2019-08-09T23:25:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![perry](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/perry/32/518_2.png) [@perry](https://discuss.ocaml.org/u/perry)\
**Post date:** [August 10, 2019, 10:57am UTC](https://discuss.ocaml.org/t/hacking-on-the-compiler/4236/2 "2019-08-10T10:57:12Z")

</div>

`.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.

---

<div class="post-metadata">

**Author:** ![ejgallego](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ejgallego/32/239_2.png) [@ejgallego](https://discuss.ocaml.org/u/ejgallego)\
**Post date:** [August 10, 2019, 3:29pm UTC](https://discuss.ocaml.org/t/hacking-on-the-compiler/4236/3 "2019-08-10T15:29:50Z")

</div>

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

For that, in a clean OCaml tree run:

```auto
./configure
dune build @world

```

This is pretty experimental tho so YMMV.

---

<div class="post-metadata">

**Author:** ![brettgilio](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/brettgilio/32/1933_2.png) [@brettgilio](https://discuss.ocaml.org/u/brettgilio)\
**Post date:** [August 10, 2019, 6:12pm UTC](https://discuss.ocaml.org/t/hacking-on-the-compiler/4236/4 "2019-08-10T18:12:44Z")

</div>

Thank you @ejgallego that worked well!
