Objective Caml - A general purpose high-level programming language

Didier Rémy, Xavier Leroy, Pierre Weis

INRIA Rocquencourt

Appeared in ERCIM News No. 36

Abstract: Objective Caml is a general purpose programming language that combines functional, imperative, and object-oriented programming. The language is statically typed; its type system ensures the correct evaluation of programs. Types are automatically inferred. The language offers powerful constructions such as user-definable data-types, the ability to define functions by pattern-matching, and an exception mechanism. Programming in the large is facilitated by a full-fledge class-based object-oriented layer and an expressive module system.

Objective Caml belongs to the ML family of programming languages and has been implemented at INRIA Rocquencourt within the ``Cristal project'' group. Since ML's inception in the late seventies, there has been a continuous line of research at INRIA devoted to implementations and improvements of ML. Objective Caml owes a lot to the original core ML language and to our first Caml implementation (1985-1990). A new byte-coded implementation called Caml Light was developed in the early nineties. The language Caml Light is still in use, especially for education. The language was renamed Objective Caml after the incorporation of a sophisticated module system and an object-oriented layer.

As all dialects of ML, Objective Caml possesses:

In addition, Objective Caml features:

The Objective Caml implementation comes with general purpose libraries (arbitrary precision arithmetics, multi-threading, a toolkit for graphical user interfaces, etc.) and a Unix-style programming environment including a replay debugger and a time profiler. Objective Caml programs can easily be interfaced with other languages, in particular with other C programs or libraries. The implementation is targeted towards separate compilation of stand-alone applications, although interactive use via a read-eval-print loop is also supported. Both compilation to byte-code (for portability) and to native assembly code (for performance) are supported. The native code compiler generates very efficient code, complemented by a fast, unobtrusive incremental garbage collector. The implementation runs on most Unix platforms (Linux, Digital Unix, Solaris, IRIX), under Windows 95 and NT, and on the Macintosh.

Objective Caml has been used in numerous applications involving symbolic computation (automatic theorem proving, compilation and interpretation, program analyses), and for the rapid development of applications in various areas: tools for the Web (browsers, intelligent proxies), network protocols (the Ensemble distributed communication system at Cornell, the SwitchWare active networking project at U. Penn.), distributed computation, etc. The interactive system is well suited to scripting; the byte-code compiler and its dynamic linking capabilities make it possible to send or receive compiled programs from remote sites.

The Caml language is widely used for teaching in France at both undergraduate and graduate levels. It is also used in many academic projects in Europe, Japan, North and South America. Several large French corporations develop significant industrial projects in Objective Caml, including France Télécom, Dassault, and CEA (Commissariat à l'Énergie Atomique).

INRIA is setting up a Caml consortium, inspired by the World Wide Web consortium. It will offer industrial and academic partners to participate in the development, the maintenance, and the definition of new features of the language.

The Objective Caml implementation as well as extensive documentation on Caml are freely available on the Web, http://caml.inria.fr/pub/old_caml_site/