ML (Meta Language) is a functional programming language created by Robin Milner. It pioneered type inference and influenced virtually every statically-typed functional language that followed, including Haskell, OCaml, and F#.
Origins
Milner developed ML in the 1970s at the University of Edinburgh as the metalanguage for the LCF theorem prover. He needed a language where programs could be guaranteed type-safe—essential when those programs were supposed to prove theorems.
Key Innovations
ML introduced concepts now standard in programming:
- Type inference: The compiler deduces types without explicit annotations
- Hindley-Milner type system: Sound, complete type inference algorithm
- Parametric polymorphism: Generic functions that work on any type
- Algebraic data types: Sum types and product types
- Pattern matching: Destructuring data in function definitions
Dialects
ML spawned influential dialects:
- Standard ML (SML): Standardized version
- OCaml: ML with object-oriented features
- F#: ML for .NET
- Reason: Facebook’s ML-like syntax for OCaml
Impact
ML’s type system influenced nearly every modern typed language. TypeScript, Rust, Swift, and Kotlin all show ML’s influence in their type inference and algebraic data types. The Hindley-Milner algorithm remains fundamental to programming language theory.