The ocamlnat 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.
See below for download links and installation instructions.
#use "topfind";;similar to the byte code toplevel.
Download the latest source code release ocamlnat-0.1.1.tar.bz2 (or any other release from the list above), and extract the source distribution tarball using the following command:
$ tar xjf ocamlnat-0.1.1.tar.bz2 $ cd ocamlnat-0.1.1
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.
$ 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 0.1.1 (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.
Available on GitHub: http://github.com/bmeurer/ocamlnat
Clone the project with Git by running:
$ git clone git://github.com/bmeurer/ocamlnat.git
If you come across any problems, please create a ticket and we will try to get it fixed as soon as possible.
Once you have made your commits:
Copyright © 2010-2011 Benedikt Meurer. See the LICENSE file for details.