The Ocaml reference article from the English Wikipedia on 24-Apr-2004
(provided by Fixed Reference: snapshots of Wikipedia from wikipedia.org)

Ocaml

People like you are child sponsors
Objective CAML, also known as Ocaml or O'Caml for short, is an advanced programming language based on the ML family. It is developed at INRIA, succeeded the earlier Caml Light. Its prime designer is Xavier Leroy.

Caml originally stood for Categorically Abstract Machine Language but Caml has long not been based on this abstract machine (see Heavy Caml). To the functional and imperative features of ML , it adds object-oriented concepts and some minor syntax differences.

Ocaml provides both a bytecode compiler and a native code compiler, and the latter has been ported to a large number of platforms. The code generated by the native compiler is typically comparable to C/C++ in speed. Powerful features of the language include a static type system, type inference, pattern matching, an exception mechanism, and automatic memory management. Ocaml distributions include general purpose libraries and are available for a wide range of platforms, including Unix and Windows.

Ocaml is used in a wide range of applications including theorem proving and program analysis. OCaml features are pragmatically balanced between expressivity and new features on the one side, ease of interfacing with existing systems and libraries and efficiency on the other side. On the one side, OCaml has many high-level constructs (polymorphism, functional types, objects, functors [parametric modules] etc...) and the absence of memory corruptions is guaranteed by type safety. On the other hand, the runtime system was designed so as to be fast and efficient, and rather frugal in memory compared to other runtime systems for high-level languages (see Java); there is support for Unix system calls, linking with C primitives, and even C- and FORTRAN-compatible "big arrays". Programs implemented in Ocaml have won prizes several times in the ICFP programming contest.

OCaml is used as an introductory language in many universities, including École Normale Supérieure and Caltech.

OCaml is criticized for several reasons. Unlike languages like Haskell, OCaml isn't purely functional, having features like references, while and Pascal-style for loops, and mutable records, leading to criticism that it should be more functional. Haskell and similar languages also support structured polymorphism, something which OCaml lacks in order to allow for complete type inference and elimination of runtime type information. There is also criticism from the other side of the spectrum; some people say that OCaml isn't object-oriented enough because there is a difference between types and classes, and because classes aren't first-class objects and cannot be modified after initialization. More generally, there exist several ways to express polymorphism (straight polymorphism, objects, functors...) with no unifying system.

See also

External links


Programming languages
Ada | Algol | APL | BASIC | C | C++ | C# | Cg | COBOL | Common Lisp | ColdFusion | Delphi | Eiffel | Forth | FORTRAN | Haskell | Java | JavaScript | Jython | Lisp | Logo | Mesa | ML | Modula-2 | Oberon | Objective-C | Objective Caml | Pascal | Perl | PHP | PL/I | PostScript | Powerbuilder | Prolog | Python | QBASIC | REXX | Ruby | Scheme | Smalltalk | Tcl/Tk | Visual Basic