The project provides a new native code OCaml toplevel ocamlnat, which is mostly compatible to the byte code toplevel ocaml, but up to 100 times faster. It is based on the optimizing native code compiler, the native runtime and an earlier prototype by Alain Frisch. It is build upon Just-In-Time techniques and currently supports Unix-like systems (i.e. Linux, BSD or Mac OS X) running on x86 or x86-64 processors. Support for additional architectures and operating systems is planned, but not yet available.

Download the latest source code release ocamlnat-.tar.bz2 (or any other release from the list above), and extract the source distribution tarball using the following command:

tar xjf ocamlnat-.tar.bz2
cd ocamlnat-

The installation is similar to the installation of any other OASIS based software package, so make sure to consult the INSTALL and README files if you run into trouble.

Assuming that you want to install ocamlnat into /usr/local on a Unix-like system (i.e. Linux, BSD or Mac OS X), proceed as follows:

ocaml setup.ml -configure
ocaml setup.ml -build

These are basically the standard configuration and build steps as described in the INSTALL file. Feel free to pass additional parameters the configuration phase if you need to.

The final step is to install ocamlnat into the selected binary directory (i.e. /usr/local/bin).

sudo ocaml setup.ml -install

Et voila, now you can use your new native toplevel ocamlnat. Assuming that you installed it into /usr/local, then you can execute it using the following command, which presents you with an interactive toplevel prompt, i.e.:

$ /usr/local/bin/ocamlnat
ocamlnat version (OCaml version 3.12.1)
#

You can use it as a drop-in replacement for the byte code toplevel ocaml in almost all cases, and enjoy a performance boost of up to 100x (compared to the byte code toplevel), as detailed here and here.