When did functional programming begin? - 1952, "Th...
# of-functional-programming
d
When did functional programming begin? • 1952, "The Use of Sub-Routines in Programmes", D.J.Wheeler, https://dl.acm.org/doi/pdf/10.1145/609784.609816 Mentions higher order functions like "integrate", which is (somehow) parameterized by the function to be integrated. • 1956, Fortran, John Backus. FORTRAN=FORmula TRANslation. Fortran supports nested arithmetic expressions. "Programming on the right side of the assignment statement" is an early glimpse of expression-oriented functional programming, as mentioned later in [Landin 1966]. • 1960, LISP, John McCarthy, "_Recursive functions of symbolic expressions and their computation by machine, part I_". Lisp is the first programming language with conditional expressions, recursive functions, higher order functions (including "map" under the name "maplist"), plus garbage collection. This is the true birth of functional programming, even though LISP has a strong imperative core, and some key elements are missing: LISP is not lexically scoped; there are no closures, and no convenient syntax for curried function calls. http://www-formal.stanford.edu/jmc/recursive.pdf • 1962, APL, Kenneth Iverson, the book "A Programming Language" is published. Has an exceptionally powerful expression language, including the now standard "map" and "reduce" higher order functions (under different names). There is no APL interpreter yet. http://www.softwarepreservation.org/projects/apl/Books/APROGRAMMING%20LANGUAGE • 1964, P.J.Landin, "The Mechanical Evaluation of Expressions" describes a referentially transparent, lexically scoped, pure functional language with lexically scoped closures and curried functions. The syntax is a recognizable precursor to ML and Haskell. A virtual machine called the SECD machine is described for implementing functional languages (including lexical scoping and closures, which are missing from LISP). Earliest use of "referential transparency" to describe a programming language? https://www.cs.cmu.edu/~crary/819-f09/Landin64.pdf • 1966, P.J.Landin, "The Next 700 Programming Languages". This is the earliest published use of the term "functional programming" I can find, although it is by now reportedly in common use. This is the original manifesto for functional (ie, non-imperative) programming. It describes the research language ISWIM, spawning the ML/Haskell lineage of functional languages. http://www-formal.stanford.edu/jmc/recursive.pdf
i
Something I'm curious about, along these lines — what were the first computer languages that were in acknowledged as being related to / derived from lambda calculus? Anything prior to this? 1965, P.J. Landin, "Correspondence between ALGOL 60 and Church's Lambda-notation" https://dl.acm.org/doi/10.1145/363744.363749 My curiosity stems from.. wondering at what point people in the nascent PL world realized that there correspondences with the work being done to pin down math's foundations.
w
For me FP hits its stride somewhere between non-strict evaluation and type classes.
d
@Ivan Reese After Fortran exploded onto the scene in 1956, the record suggests that in the late 1950's, computer scientists on both sides of the Atlantic were working on programming languages inspired by lambda calculus. The lambda calculus is a mathematical formalism: it is a model of the "recursive functions" aka the "computable functions". It is not a programming language. For one thing, there is no defined order of evaluation. Two popular choices are applicative order (most programming languages) and normal order (Algol 60 and Haskell). Normal order evaluation is more powerful, because it terminates and produces a result in cases where applicative order evaluation fails to terminate. On the American side, McCarthy was a theoretician, and LISP was originally intended to be a mathematical model of the recursive functions, heavily inspired by lambda calculus, that was also executable on a computer. The ability to represent lambda expressions as data structures ("S-expressions" or symbolic expressions) was a key idea of Lisp. It led to Lisp FEXPRs and macros. But the identification of functions with LAMBDA expressions prevented early LISP from representing function values as closures or supporting lexical scoping. LISP has always used applicative order evaluation (except for FEXPRs and MACROs). Across the Atlantic, Algol 60 was the successor to Algol 58 (aka IAL). In Algol 60, function parameters by default use "call by name" as the parameter passing mechanism (normal order evaluation). If you explicitly use the "value" keyword then you get "call by value", aka applicative order evaluation. It's just like using the ! operator in Haskell to force a function parameter to be strict. Allegedly, this strange choice of "call by name" as the default parameter passing mechanism was directly inspired by lambda calculus, where normal order evaluation is more powerful. I'd like to know who put normal order evaluation into the Algol 60 standard. However, Algol 60 is an imperative language, and the interaction between call-by-name and side effects made programs difficult to understand. The performance was also terrible, so call-by name gained a bad reputation and was dropped. It didn't reappear (AFAIK) until Haskell.