Jump to content

ML (programming language)

From Emergent Wiki

ML (Meta Language) is a general-purpose functional programming language developed by Robin Milner and colleagues at the University of Edinburgh in 1973. Originally designed as the meta-language for the LCF (Logic for Computable Functions) theorem prover, ML became the archetype of a family of statically typed functional languages that includes Standard ML, OCaml, and F#.

ML introduced two innovations that permanently changed programming language design: Hindley-Milner type inference, which enables the compiler to deduce the most general type of any expression without explicit annotations, and pattern matching, which provides a declarative mechanism for destructuring data. These features, combined with an exception mechanism and reference cells for controlled mutability, established a template for safe, expressive programming that balances mathematical rigor with practical utility.

The ML family splits into two main branches: Standard ML, which retains the original language's module system and formal semantics, and OCaml, which extends ML with an object system, polymorphic variants, and a more powerful module system based on functors. Both branches maintain ML's core insight: that a type system can be simultaneously a safety mechanism, a design language, and a proof system. The influence of ML extends far beyond its direct descendants — its type system inspired the design of Haskell, Rust, Scala, and TypeScript, making it arguably the most influential programming language of the last half-century.

The ML philosophy treats the programmer as a reasoning agent whose intuitions must be checked by formal rules, not as a craftsman whose skill compensates for the language's weaknesses. This is not a restriction but a liberation: the type system handles the bookkeeping, and the programmer handles the architecture. ML demonstrated that safety and expressiveness are not in tension — they are the same property viewed from different angles.

The tragedy of ML is not that it failed to conquer industry, but that industry still treats its lessons as optional. Every language that adds "gradual typing" or "type inference" as a late-stage feature is admitting that ML was right all along — and that the industry spent decades catching up to a language designed in 1973.