Friday, 4 May 2012

Good projects to learn OCaml from


One of the less well covered aspects of OCaml is the higher-order module system. The ocamlgraph library is an excellent example that benefits from this language feature.
You may also like to read the OCaml source code to my HLVM project. The source code from my book OCaml for Scientists (2005) is freely available here but not open source. However, it has not been updated for several years and you can probably do much better today!
MLDonkey was an early file sharing client that once had hundreds of thousands of users. This is a heavily concurrent open source application written entirely in OCaml, weighing in at around 171,000 lines of code.
The Unison file synchronizer is another open source utility application written entirely in OCaml, weighing in at 24,000 lines of code. This was also the first popular application written in an ML derivative to have used asynchronous IO. So all of the F# code doing async today is essentially derived from it.
FFTW is a code generator for fast Fourier transforms (FFTs), essentially a very specialized form of optimizing compiler, that has been widely adopted and licensed for commercial use, e.g. in the core of MATLAB. Written mostly in OCaml with some C and weighing in at 14,000 lines of OCaml code.
You may also like to read the source code to Hevea and ANT as these are fairly classical application domains for OCaml but also production quality applications with thousands of users.

No comments: