User:Doshir/OCaml

Development of ML
Between the 1970s and 1980s, Robin Milner, a British computer scientist and Turing Award winner, worked at the University of Edinburgh's Laboratory for Foundations of Computer Science. Milner and others were working on theorem provers, which were historically developed in languages such as Lisp. Milner repeatedly ran into the issue that the theorem provers would attempt to claim a proof was valid by putting non-proofs together. As a result, he went on to develop the meta language for his Logic for Computable Functions, a language that would only allow the writer to construct valid proofs with its polymorphic type system. ML was turned into a compiler in order to simplify using LCF on different machines, and, by the 1980s, was turned into a complete system of its own. ML would eventually serve as a basis for the creation of OCaml.

In the early 1980s, there were some developments that prompted INRIA's Formel team to become interested in the ML language. Luca Cardelli, a research professor at University of Oxford, used his Functional Abstract Machine to develop a faster implementation of ML, and Robin Milner proposed a new definition of ML in order to avoid divergence between various implementations. Simultaneously, Pierre-Louis Curien, a senior researcher at Paris Diderot University, developed a calculus of categorical combinators and linked it to lambda calculus, which led to the definition of the Categorical Abstract Machine (CAM). Guy Cousineau, a researcher at Paris Diderot University, recognized that this could be applied as a compilation technique for ML.

First Implementation
Caml was initially designed and developed by INRIA's Formel team headed by Gérard Huet. The first implementation of Caml was created in 1987 and was further developed until 1992. Though it was spearheaded by Ascánder Suárez, Pierre Weis and Michel Mauny carried on with development after he left in 1988.

Guy Cousineau is quoted recalling that his experience with programming language implementation was initially very limited, and that there were multiple inadequacies for which he is responsible. Despite this, he believes that "Ascander, Pierre and Michel did quite a nice piece of work.”

Caml Light
Between 1990 and 1991, Xavier Leroy designed a new implementation of Caml based on a bytecode interpreter written in C. In addition to this, Damien Doligez wrote a memory management system, also known as a sequential garbage collecto r, for this implementation. This new implementation, known as Caml Light, replaced the old Caml implementation and ran on small desktop machines. In the following years, libraries such as Michel Mauny's syntax manipulation tools appeared and helped promote the use of Caml in educational and research teams.

Caml Special Light
In 1995, Xavier Leroy released Caml Special Light, which was an improved version of Caml. An optimizing native-code compiler was added to the bytecode compiler, which greatly increased performance to comparable levels with mainstream languages such as C++. Additionally, Leroy designed a high-level module system inspired by the module system of Standard ML which provided powerful facilities for abstraction and parameterization and made larger-scale programs easier to construct.

Objective Caml
Didier Rémy and Jérôme Vouillon designed an expressive type system for objects and classes, which was integrated within Caml Special Light. This led to the emergence of the Objective Caml language, first released in 1996 and subsequently renamed to OCaml in 2011. This object system notably supported many prevalent object-oriented idioms in a statically type-safe way, while those same idioms caused unsoundness or required runtime checks in languages such as C++ or Java. In 2000, Jacques Garrigue extended Objective Caml with multiple new features such as polymorphic methods, variants, and labeled and optional arguments.

Ongoing Development
Language improvements have been incrementally added for the last two decades in order to support the growing commercial and academic codebases in OCaml. The OCaml 4.0 release in 2012 added Generalized Algebraic Data Types (GADTs) and first-class modules in order to increase the flexibility of the language. The zeroth alpha release of OCaml 5.0.0 was released on 14th June 2022.

OCaml's development continued within the Cristal team at INRIA until 2005, when it was succeeded by the Gallium team. Subsequently, Gallium was succeeded by the Cambium team in 2019.

Options
The option type constructor in OCaml, similar to the Maybe monad in Haskell, augments a given data type to either return Some value of the given data type, or to return None. This is used to express that a value might or might not be present. This is an example of a function that either extracts an int from an option, if there is one inside, and converts it into a string, or if not, returns an empty string: