Overview of the Caml Light implementation

The Caml Light system comprises the following parts:


Caml Light is freely distributed for non-commercial use. Click here to transfer it.

Caml Light is available on the following platforms:

Hardware requirements

Caml Light is implemented as a bytecode compiler (it produces code for an abstract machine, which is then interpreted by a C program), hence it is small, portable and has modest memory requirements. The runtime system (the part written in C) is about 100K, plus another 100K of bytecode for the compiler. The compiler itself is written in Caml Light and ``bootstrapped'' -- compiled by itself. 2 megabytes of memory are enough to recompile the whole system. Other implementations of ML generally use up at least ten times more memory. The generated standalone programs are very small.


Because of the overhead of interpreting the bytecode, programs generated by Caml Light run about ten times slower than programs generated by the best native-code compilers. The slowdown is more important for programs performing mostly arithmetic operations and loops, and less important for highly symbolic computations.

Owing to their small memory footprints, Caml Light programs start up quickly and do not cause virtual memory thrashing. Combined with generational, incremental garbage collection, this makes interactive Caml Light programs very responsive, with no annoying pauses in the middle of user interaction.

The Caml Light compiler is so small and simple that it runs very quickly (above 200 lines/second on a modern workstations), much faster than native-code compilers. During the development phase, this often compensates for the slow execution of the generated program.
The interactive, toplevel-based compiler is similarly very responsive.


Caml Light is written entirely in C and in Caml. The only assumptions it makes are: a 32-bits or 64-bits architecture, with a flat address space; a good quality C compiler (ANSI or K & R); and the POSIX subsystem of Unix.