Finding something worth knowing…

Technology

A 1930s theory of pure functions became a whole way of programming

During the 1930s Alonzo Church devised a formal system of computation built from nothing but functions and their application. Alan Turing showed in 1937 that it was as powerful as his own machines. Decades later, Church's lambda calculus became the foundation of functional programming.

Most programming is imperative: a list of commands that keep changing the program's state. Functional programming instead builds programs by applying and combining functions, each mapping inputs to outputs. Functions are first-class citizens, meaning they can be named, passed to other functions and returned as results just like numbers. The purest form treats every function like a mathematical one, always giving the same answer for the same arguments and never quietly altering anything else.

John McCarthy created Lisp at MIT in the late 1950s for IBM's scientific computers, defining functions with Church's lambda notation, and it introduced many of the style's signature features. The 1956 Information Processing Language is sometimes called the first functional language, though it leaned heavily on mutable lists. Kenneth Iverson's APL of the early 1960s inspired John Backus, whose 1977 Turing Award lecture asked whether programming could be freed from the von Neumann style and spurred wide research.

The 1970s brought a burst of languages. Robin Milner created ML at Edinburgh in 1973, and it later branched into OCaml and Standard ML. Guy Steele and Gerald Sussman built Scheme, the first Lisp dialect with lexical scoping and required tail-call optimisation. David Turner's lazy language Miranda appeared in 1985, and because it was proprietary, researchers agreed in 1987 to create an open alternative, Haskell. Per Martin-Löf's type theory of the 1980s tied programs to constructive proofs and fed into interactive theorem proving.

Long more academic than commercial, the approach is now used in industry and teaching through languages like Clojure, Erlang, Elixir and Haskell, while Lean is popular for checking mathematical proofs. It even appears in OpenSCAD, a design tool whose refusal to let values be reassigned regularly baffles newcomers.

Source: Functional programming

Related

More in Technology · All topics