← History

OCaml 1996

Functional ML with industrial teeth — type inference that catches your mistakes before they exist.

Paradigmsfunctional, imperative, modular, object-oriented, compiled
Typingstatic, strong, inferred (Hindley–Milner), with a powerful structural module system
Extensions.ml .mli
Created byXavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy, Ascánder Suárez

Influenced by: Rust

OCaml is a pragmatic, industrial-strength descendant of the ML family from France's Inria: it pairs whole-program Hindley–Milner type inference with algebraic data types, exhaustive pattern matching, and a uniquely expressive module-and-functor layer. You get the safety and concision of a functional language without giving up speed, mutation, or objects when you need them — code reads like math but compiles to fast native binaries. It is the language behind Jane Street's trading systems, the Rocq/Coq proof assistant, MirageOS unikernels, and the first Rust compiler.

What makes it distinctive

History

OCaml is the latest member of the Caml lineage, a family of ML dialects developed at Inria (France's national institute for research in computer science). The original Caml appeared in 1987, designed by Gérard Huet, Guy Cousineau, Ascánder Suárez, Pierre Weis and others; the name nods to the Categorical Abstract Machine it first targeted, though the team happily leaned into the camel mascot anyway. ML itself — the language Caml descends from — had been invented by Robin Milner in the 1970s as the meta-language for the LCF theorem prover, and brought with it the type-inference algorithm now known as Hindley–Milner.

In 1990 Damien Doligez and Xavier Leroy built Caml Light, a small, portable reimplementation running on a bytecode interpreter with a fast generational garbage collector. It was compact enough to fit on the machines of the era and became widely used for teaching. Leroy followed it in 1995 with Caml Special Light, which added a native-code compiler and, crucially, a complete module system with functors inspired by Standard ML — parameterised modules that let you write code generic over whole structures, all checked at compile time.

Objective Caml arrived in 1996 when Didier Rémy and Jérôme Vouillon grafted a sound, type-inferred object-oriented layer onto Caml Special Light — a genuinely novel piece of type theory, since objects and Hindley–Milner inference are hard to reconcile. This is the release that, fifteen years later in 2011, was simply renamed OCaml. The combination of functional core, imperative escape hatches, modules, and objects in one statically typed language gave OCaml its enduring multi-paradigm character.

Throughout the 2000s OCaml earned a reputation as the connoisseur's compiled language: small, fast, and ruthlessly type-safe. It powered Inria's Coq proof assistant (renamed Rocq in 2025) and the Astrée static analyzer used to verify Airbus flight-control software. Famously, Graydon Hoare's first compiler for Rust was written in OCaml before Rust became self-hosting — one of several languages, alongside F#, Scala, Elm and ReasonML, that carry OCaml's fingerprints.

OCaml 4.0 (2012) was a watershed release, adding GADTs (generalized algebraic data types) and first-class modules, letting modules be passed around as ordinary values. The 4.x series ran for a decade and became the bedrock of the language's industrial adoption, most visibly at Jane Street, the trading firm that writes essentially its entire stack in OCaml, open-sourced the Core standard library and the Dune build system, and bankrolled much of the modern toolchain.

The long-running grand challenge was parallelism: OCaml's classic runtime had a single global heap and no shared-memory threads. After roughly a decade of research, OCaml 5.0 (December 2022) delivered a complete runtime rewrite — the Multicore project — bringing genuine shared-memory parallelism via domains and, alongside it, effect handlers: a structured, typed form of resumable control flow that powers lightweight concurrency without monad gymnastics. It was a rare feat: adding parallelism and algebraic effects to a 25-year-old language while keeping existing single-threaded code working.

Development continues at a steady clip. The 5.x series has added refinements such as deep effect-handler syntax (5.3) and, in 5.4 (October 2025), labelled tuples, immutable arrays, and atomic record fields. The current stable release is 5.4.1 (February 2026). Tooling has matured in parallel — opam for packages, Dune for builds, Merlin and the OCaml LSP for editor intelligence, and js_of_ocaml / Melange for compiling to JavaScript — turning what was once a niche academic language into a quietly thriving production ecosystem.

Resources

See it in Code Compare →