A Brief History of
Functional
Programming
λ
Introductions
• Twitter: @treLeComte
• Github:
https://github.com/trezona-
lecomte
• LinkedIn:
https://nz.linkedin.com/in/trezo
nalecomte
• Programming for about 3
years
• At work: Ruby on Rails,
MySQL
• At home: Haskell, Elm,
PostgreSQL
About me
Introductions
What about you?
Why talk about history?
Standing on the shoulders of giants
“Bernard of Chartres used to compare us to dwarfs perched
on the shoulders of giants. He pointed out that we see more
and farther than our predecessors, not because we have
keener vision or greater height, but because we are lifted up
and borne aloft on their gigantic stature.”
- John of Salisbury (1159)
Why talk about history?
We’re skipping a lot
• Ada Lovelace
• Charles Babbage
• George Boole
• Bertrand Russell
• Kurt Gödel
• Rózsa Péter
• Claude Shannon
• … so many more
Let’s begin with λ
• 1936: Alonzo Church published
what we now know as the
‘untyped lambda calculus’
• Often referred to as λ-calculus
• Universal model of computation
Let’s begin with λ
This is not a λ-calculus tutorial, so I’ll recommend:
• https://www.inf.fu-berlin.de/lehre/WS03/alpi/lambda.pdf - a
'short and painless' introduction
• Chapter 1 of http://haskellbook.com if you’re learning
Haskell and have the $$
Lisp
• 1958: John McCarthy invents LISP (LISt Processor)
• Lisp pioneers:
- Higher-order functions
- Recursion
- Dynamic typing
- Conditionals
- Garbage Collection
- The REPL (Read-Eval-Print-Loop)
- Programs as data, or meta-programming
Higher order?
A higher-order function either:
• Takes a function as an argument
• Returns a function as a result
(define mapcar (func list)
(if (null list)
nil
(cons (func (car list)) (mapcar func (cdr list)))))
Note that Lisp wasn’t “purely” functional…
Detour: Declarative &
Imperative
“Imperative languages are characterized as having an
implicit state that is modified (i.e. side-effected) by constructs
… in the source language.”
“In contrast, declarative languages are characterized as
having no implicit state, and thus the emphasis is placed
entirely on programming with expressions (or terms). In
particular, functional languages are declarative languages
whose underlying model of computation is the function …”
- Paul Hudak
ISWIM
• 1966: Peter J. Landin publishes The Next
700 Programming Languages, describing
“If you See What I Mean”
• Not an actual implementation
• But hugely influential on ML, SASL, and
Miranda
FP
• 1977: John Backus gave his Turing Award lecture, "Can
Programming Be Liberated from the von Neumann Style?”
• Introduced a language - FP (Function Programming)
• His lecture & paper sparked the next generation of
Functional Programming research
ML
• Around the same time as FP: Gordon, Milner and
Wadsworth made ML (Meta-Language)
• Another ‘impure’ functional language
• Evolved into Standard ML and OCaml
ML
• The interesting part for us is the type system:
- Strongly and statically typed
- Type inference
- Polymorphic functions and data structures
- User-defined concrete and abstract datatypes (borrowed
from Hope)
SASL, KRC, Miranda
• 1972: David Turner built SASL
(St Andrews Static Language) based on ISWIM
• 1976: He redefined SASL as a lazy language
• 1979-1981: He developed KRC (Kent Recursive
Calculator), which included guards and list
comprehensions
• 1985: He released Miranda, a successor to SASL and
KRC. It’s still alive today!
Erlang
• First developed in 1986 at Ericsson by Joe Armstrong,
Robert Virding, and Mike Williams
• Emphasis on distributed, real-time, reliable programs
• Used a lot in Telecommunications and Networking
Haskell
• 1987 FPCA Conference: there is a meeting to discuss the proliferation of non-strict (lazy)
functional languages
• The result in 1990 is Haskell, named after Haskell B. Curry, based largely on Miranda:
- Purely functional with higher-order functions
- Lazy evaluation
- Strong, static typing with type inference
- User-defined datatypes with pattern matching
- List comprehensions
- Modules
- Functional I/O system
And the list goes on…
• 1991: Python*
• 1995: JavaScript* & Ruby*
• 2004: Scala*
• 2005: F#*
• 2007: Clojure - a Lisp dialect
• 2010: Rust*
• 2011: Elixir*
• 2012: Elm & TypeScript*
• 2014: Swift*
* multi-paradigm, supports functional programming
What next?
• 2018 ???
Thanks!
λ

A brief history of functional programming (edited)

  • 1.
    A Brief Historyof Functional Programming λ
  • 2.
    Introductions • Twitter: @treLeComte •Github: https://github.com/trezona- lecomte • LinkedIn: https://nz.linkedin.com/in/trezo nalecomte • Programming for about 3 years • At work: Ruby on Rails, MySQL • At home: Haskell, Elm, PostgreSQL About me
  • 3.
  • 4.
  • 5.
    Standing on theshoulders of giants “Bernard of Chartres used to compare us to dwarfs perched on the shoulders of giants. He pointed out that we see more and farther than our predecessors, not because we have keener vision or greater height, but because we are lifted up and borne aloft on their gigantic stature.” - John of Salisbury (1159) Why talk about history?
  • 6.
    We’re skipping alot • Ada Lovelace • Charles Babbage • George Boole • Bertrand Russell • Kurt Gödel • Rózsa Péter • Claude Shannon • … so many more
  • 7.
    Let’s begin withλ • 1936: Alonzo Church published what we now know as the ‘untyped lambda calculus’ • Often referred to as λ-calculus • Universal model of computation
  • 8.
    Let’s begin withλ This is not a λ-calculus tutorial, so I’ll recommend: • https://www.inf.fu-berlin.de/lehre/WS03/alpi/lambda.pdf - a 'short and painless' introduction • Chapter 1 of http://haskellbook.com if you’re learning Haskell and have the $$
  • 9.
    Lisp • 1958: JohnMcCarthy invents LISP (LISt Processor) • Lisp pioneers: - Higher-order functions - Recursion - Dynamic typing - Conditionals - Garbage Collection - The REPL (Read-Eval-Print-Loop) - Programs as data, or meta-programming
  • 10.
    Higher order? A higher-orderfunction either: • Takes a function as an argument • Returns a function as a result (define mapcar (func list) (if (null list) nil (cons (func (car list)) (mapcar func (cdr list)))))
  • 11.
    Note that Lispwasn’t “purely” functional…
  • 12.
    Detour: Declarative & Imperative “Imperativelanguages are characterized as having an implicit state that is modified (i.e. side-effected) by constructs … in the source language.” “In contrast, declarative languages are characterized as having no implicit state, and thus the emphasis is placed entirely on programming with expressions (or terms). In particular, functional languages are declarative languages whose underlying model of computation is the function …” - Paul Hudak
  • 13.
    ISWIM • 1966: PeterJ. Landin publishes The Next 700 Programming Languages, describing “If you See What I Mean” • Not an actual implementation • But hugely influential on ML, SASL, and Miranda
  • 14.
    FP • 1977: JohnBackus gave his Turing Award lecture, "Can Programming Be Liberated from the von Neumann Style?” • Introduced a language - FP (Function Programming) • His lecture & paper sparked the next generation of Functional Programming research
  • 15.
    ML • Around thesame time as FP: Gordon, Milner and Wadsworth made ML (Meta-Language) • Another ‘impure’ functional language • Evolved into Standard ML and OCaml
  • 16.
    ML • The interestingpart for us is the type system: - Strongly and statically typed - Type inference - Polymorphic functions and data structures - User-defined concrete and abstract datatypes (borrowed from Hope)
  • 17.
    SASL, KRC, Miranda •1972: David Turner built SASL (St Andrews Static Language) based on ISWIM • 1976: He redefined SASL as a lazy language • 1979-1981: He developed KRC (Kent Recursive Calculator), which included guards and list comprehensions • 1985: He released Miranda, a successor to SASL and KRC. It’s still alive today!
  • 18.
    Erlang • First developedin 1986 at Ericsson by Joe Armstrong, Robert Virding, and Mike Williams • Emphasis on distributed, real-time, reliable programs • Used a lot in Telecommunications and Networking
  • 19.
    Haskell • 1987 FPCAConference: there is a meeting to discuss the proliferation of non-strict (lazy) functional languages • The result in 1990 is Haskell, named after Haskell B. Curry, based largely on Miranda: - Purely functional with higher-order functions - Lazy evaluation - Strong, static typing with type inference - User-defined datatypes with pattern matching - List comprehensions - Modules - Functional I/O system
  • 20.
    And the listgoes on… • 1991: Python* • 1995: JavaScript* & Ruby* • 2004: Scala* • 2005: F#* • 2007: Clojure - a Lisp dialect • 2010: Rust* • 2011: Elixir* • 2012: Elm & TypeScript* • 2014: Swift* * multi-paradigm, supports functional programming
  • 21.
  • 22.

Editor's Notes

  • #2 Before we start: Thanks to Anna for organising the meet-up! Thank you all for coming, it’s great to see people interesting in the functional programming
  • #3 I work at Flux (Powershop), we’re hiring Slides will be up on the meet-up page tonight Obviously I’m not yet a grizzled veteran of FP, so please excuse any mistakes or inaccuracies. Feel free to correct me!
  • #4 How many people are: New to programming? New to FP? Experience with FP? Please feel free to ask questions or add comments, we have time for a bit of discussion!
  • #5 Coming into programming through an OO language, we tend not to learn much history (at least that's my experience) In FP circles, though, many writings *begin* with an exploration of the history and the foundations I think this is great, and so today we’re continuing in that tradition
  • #6 You’ve probably heard the saying So, we're the dwarfs in this metaphor, and today we are learning about some of the giants who have come before us. Reference: p. 167. Retrieved April 29, 2016. https://books.google.com/books?id=pA3VbvUf67EC&lpg=PA167&ots=73r28_CEGY&pg=PA167#v=onepage&q=&f=false
  • #7 Ada Lovelace Image: https://vignette.wikia.nocookie.net/curious-expedition/images/a/a0/Lovelace.jpg/revision/latest?cb=20160129184107 Claude Shannon Image: https://en.wikipedia.org/wiki/Claude_Shannon
  • #8 Although you can think of λ-calculus as the first functional language, there were no computers to run the programs on at the time - it was pure maths Important to know about because it serves as the foundation for (almost) all functional programming language Image: https://en.wikipedia.org/wiki/Alonzo_Church
  • #9 If you want a good topic to speak about at this meet-up, talk about λ-calculus! Haskell book is about $80 NZD
  • #10 Amazing that a family of languages 60 years old is still so actively used Image: https://www.independent.co.uk/news/obituaries/john-mccarthy-computer-scientist-known-as-the-father-of-ai-6255307.html
  • #12 * Added after presentation: note the we discussed the conflation of ‘purity’ with ‘functional’, I think that this might have arisen from this slide. It would be clearer to say “Note that Lisp wasn’t a ‘pure’ functional language”, rather than “purely functional”. Whether a language is pure and whether it is functional are two separate concerns.
  • #13 So when we say that Lisp is not ‘purely’ functional, we mean that in addition to supporting programming with pure expressions it supports the imperative style of programming with sequences of mutations Reference: Paul Hudak (1989). The Conception, Evolution, and Application of Functional Programming Languages. p. 3. https://pdfs.semanticscholar.org/e694/49921581f1e00b801994236f840f5b459e00.pdf
  • #14 More on these languages in a bit Image: https://en.wikipedia.org/wiki/Peter_Landin
  • #15 Paper: https://dl.acm.org/citation.cfm?doid=359576.359579
  • #18 * http://miranda.org.uk If you’ve seen Haskell, Miranda will be very familiar to you
  • #21 Functional programming seems to be everywhere!
  • #22 It’s an exciting time to be a functional programmer!
  • #23 Questions?