Language

OCaml

First appeared
1996
Paradigm
Functional, imperative, statically typed
Toolchain
OCaml 5.3.0
Container image
debian:trixie-20261027-slim + ocaml 5.3.0-3

OCaml was released in 1996 at INRIA, the French national computer science institute, by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy, and others. It grew from the ML family of languages, first built in the 1970s to write proofs about programs. The trading firm Jane Street writes most of its software in it, and the Rocq proof assistant (formerly Coq) is written in it.

Like Haskell, OCaml is functional and checks every type before the program runs, working most of them out on its own. Unlike Haskell, it runs each line in order, and it lets you use loops and change arrays in place when that’s clearer. The standard library has lists, arrays, hash tables, sorting, and file reading. Packages from opam, OCaml’s package manager, aren’t installed here. The run script compiles each program to native code with ocamlopt and treats every warning as an error.

Quirks

Concepts in OCaml

Run the examples locally

You need Docker and Python 3. The harness builds the pinned container and runs every OCaml example:

git clone https://github.com/qnixon/dswithx.git
cd dswithx
python3 harness/run_tests.py --language ocaml