-
Notifications
You must be signed in to change notification settings - Fork 5
Getting started hacking the compiler
- A unix-like system (Linux, MacOSX, etc.)
- gcc and GNU Make.
- git
Just clone the official Github repository to get a local copy of the sources:
$ git clone https://github.com/ocaml/ocaml.git
For significant chunks of work, forking the repository on GitHub will make it easier to share patches, merge changes, etc.
There are several people around who are familiar with git and happy to help, so don't be shy about asking for guidance if you're not sure what to do.
The INSTALL in the OCaml distribution contains full instructions. For the impatient, the following will build the compiler:
$ ./configure
$ make world.opt
See the HACKING.adoc file for more information on the source tree.
-
First, install Gabriel Scherer's opam-compiler-conf script
-
Do the following to compile and install your experimental compiler. Switch to new compiler environment accordingly
$ opam compiler-conf configure $ make -j world.opt $ opam compiler-conf install
Optionally, verify you are indeed using experimental compiler by checking
ocaml -version
. -
Now, we install Merlin. Use
opam info merlin
to make sure available version of Merlin is at least version 2.3. Otherwise, runopam update
$ opam install merlin
-
Try use Merlin to type compiler source code. If that does not work out, try restart your editor.
-
When you are happy with your compiler and want to try it out, do
$ make -j world.opt $ opam compiler-conf reinstall
The last command will also compile Merlin (and all packages) again using new compiler.
The Things to work on page has a list of suggested projects. The official OCaml bug-tracker lists many more reported issues and feature requests. Tasks tagged junior_job
may be particularly suitable for the inexperienced, but the tagging is very far from exhaustive, so feel free to look around. A couple more things worth knowing:
- the
assigned
state doesn't necessarily mean that you should not work on the issue, since many bugs are auto-assigned by area of responsibility, and patches may still be welcome - issues in the
resolved/suspended
state are not considered closed; the core developer team isn't intending to work on such issues further but, again, patches may still be welcome
If you choose to work on something that's not currently listed under Things to work on, it'd be helpful if you could add it to that page.
Collaboration is strongly encouraged! Please indicate on the Things to work on page if you start work on an issue, if you would be willing to act as a mentor, etc.
Patches can be submitted as github pull requests.