Languages / Concept

1973

ML

The meta language that made the type checker your ally.

ML — “Meta Language” — was created by Robin Milner in Edinburgh around 1973, and it did not start out as a general-purpose language at all. It was the language you wrote proof tactics in for the LCF theorem prover. But to make that safe, Milner gave it a type system so good that it changed how a whole branch of the field thinks about data.

Three ideas came out of ML and spread everywhere:

  • Algebraic data types — a value is precisely one of a fixed set of shapes, and the compiler tracks which.
  • Exhaustive Pattern Matching — handle every shape or it will not compile.
  • Hindley-Milner type inference — full static type safety while you write almost no type annotations; the compiler works them out.

Milner summed up the payoff as “well-typed programs cannot go wrong.” The ML family runs from Standard ML and OCaml onward, and its ideas are the backbone of Haskell, F#, and the type systems of Rust and Swift. (Milner won the Turing Award in 1991, also for his separate work on the theory of concurrency.) Fittingly, the earliest MLs were themselves implemented in Lisp.

Sources

See also: Pattern Matching, Lisp, Clojure.