Penguin
Note: You are viewing an old revision of this page. View the current version.

Objective Caml, or OCaml, is a programming language, easy to learn, easy to use, and yet amazingly powerful. It is a dialect of ML. Objective Caml features a powerful modules system, full support to object-oriented paradigm, and an optimizing compiler.

More info here: http://caml.inria.fr/
And here: http://www.ocaml.org

Software in OCaml: http://www.npc.de/ocaml/linkdb/

The O'Reily book on OCaml: Developing Applications With Objective Caml (this is very good)

An OCaml tutorial

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 an subset of Objective Caml, so there is little other reason to use it.)

OOP

One of OCaml's extentions 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.

A big improvement is that container classes are polymorphic. 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: a core library, types and function available at all times; an implementation independent standard library, modules that can be imported; and set of optional libraries that are either implementation dependent or special purpose.

The "str" regular expression library that comes with Ocaml is rather clumsy. I recommend the PCRE library instead.

OCaml Third-Party Libraries: The Caml Link Database and The Hump are the central repositories for Ocaml? software.


CategoryProgrammingLanguages