OCaml (Objective Caml) is a functional ProgrammingLanguage that's easy to learn and use yet amazingly powerful. It is a dialect of ML and features a powerful modules system, full support of ObjectOrientation, and an optimizing Compiler.

The OCaml implementation

There is a single OpenSource implementation of OCaml developed by INRIA (the main French research institute for computer science). A large community of users who don't want their code broken pressure the Ocaml development team to keep new versions standard or backwards compatible. Python and Perl are developed the same way. This approach works well once the community user is large enough. Ocaml's user community has been the necessary size for many years.

(An interpreter for the older Caml Light language is still available because it can be made to work on small computers, e.g. 286 PCs. It is a subset of Objective Caml, so there is little other reason to use it.)


One of OCaml's extensions to the original ML language is ObjectOrientation. OCaml's OOP has everything you'd expect after using Java or C++. The syntax is quite different -- class declarations are much more compact.

PolymorphicTypes are a big improvement for container classes. In C++ and Java container objects only recognise objects inside themselves as being members of the Object class. You have to cast objects back the appropriate class when you remove them from the container. In OCaml, if you want a container object to specifically contain objects that are of the class fruitbat, you can say so.

See Objects in Caml

The OCaml Library

OCaml's library is divided into:

The str RegularExpression library that comes with OCaml is rather clumsy. I recommend the PCRE library instead.

See also

CategoryProgrammingLanguages, CategoryFunctionalProgrammingLanguages