History of Haskell - Slides
History of Haskell - Slides
A history of Haskell
Paul Hudak, Yale University
John Hughes, Chalmers University,
Simon Peyton Jones, Microsoft Research
Phil Wadler, University of Edinburgh
The late 1979s, early 1980s
Pure functional programming: Lazy functional
recursion, pattern matching, programming
comprehensions etc etc (Friedman, Wise,
(ML, SASL, KRC, Hope, Id) Henderson, Morris, Turner)
Backus 1978
Can programming be
liberated from the von
Neumann style?
new languages
Backus
and new computers
Can programming be
liberated from the von
Chaos
Many, many bright young things
Many conferences
(birth of FPCA, LFP)
Many languages
(Miranda, LML, Orwell, Ponder, Alfl, Clean)
Many compilers
Many architectures
(mostly doomed)
Crystalisation
FPCA, Sept 1987: initial meeting.
A dozen lazy functional programmers, wanting to agree
on a common language.
Suitable for teaching, research, and application
Formally-described syntax and semantics
Freely available
Embody the apparent consensus of ideas
Reduce unnecessary diversity
Absolutely no clue how much work we were taking on
Led to...a succession of face-to-face meetings
Timeline
Sept 87: kick off; choose name
Dorothy
Sarah
Haskell the cat (b. 2002)
Timeline
Sept 87: kick off
Haskell
Haskell + extensions
development • Dynamic, exciting
• Unstable,
undocumented,
implementations vary...
Timeline
Sept 87: kick off
1,000,000
10,000
100
1,000,000
10,000
100
The slow death
Geeks
1,000,000
10,000
The complete
100 absence of death
Geeks
10,000
100
The second life?
Geeks
eg.
getChar :: IO Char
putChar :: Char -> IO ()
Connecting I/O operations
eg.
getChar >>= (\a ->
getChar >>= (\b ->
putChar b >>= (\() ->
return (a,b))))
The do-notation
do {
getChar >>= \a -> a <- getChar;
==
getChar >>= \b -> b <- getChar;
putchar b >>= \()-> putchar b;
return (a,b) return (a,b)
}
No effects
Useless
Dangerous Safe
The challenge of effects
Plan A
(everyone else)
No effects
Useless
Dangerous Safe
Two basic approaches: Plan A
Default = Any effect
Arbitrary effects Plan = Add restrictions
Envy
Plan B
(Haskell)
No effects
Useless
Dangerous Safe
Lots of cross-over
Plan A
(everyone else)
No effects
Useless
Dangerous Safe
SLPJ conclusions
One of Haskell’s most significant
contributions is to take purity seriously,
and relentlessly pursue Plan B
Hey, what’s
Wild enthusiasm the big
deal?
Despair Hack,
Incomprehension hack,
hack
Wadler/ Extensible
Multi- records (1996) Computation
Blott
parameter at the type
type
type classes level
classes
(1989) (1991) Functional
dependencies
(2000) Generic
Overlapping programming
instances
“newtype
deriving” Associated Testing
types (2005)
Derivable
type classes
Applications
Variations
Type classes summary
A much more far-reaching idea than we
first realised: the automatic, type-driven
generation of executable “evidence”
Many interesting generalisations, still
being explored
Variants adopted in Isabel, Clean,
Mercury, Hal, Escher
Danger of Heat Death
Long term impact yet to become clear
Process
and
community
A committee language
No Supreme Leader
A powerfully motivated design group who
trusted each other
The Editor and the Syntax Tzar
Committee explicitly disbanded 1999
Language complexity
“Languages are too complex,
fraught with dispensable features
and facilities.” (Wirth, HOPL 2007)
Much superficial complexity (e.g.
redundant syntactic forms),
No formal semantics
Nevertheless, underpinned by
Deeply Held Principles
“Deeply held principles”
System F is GHC’s intermediate language
(Well, something very like System F.)
data Expr
= Var Var
| Lit Literal
| App Expr Expr
| Lam Var Expr
| Let Bind Expr
| Case Expr Var Type [(AltCon, [Var], Expr)]
| Cast Expr Coercion
| Note Note Expr
| Type Type
type Coercion = Type
data Bind = NonRec Var Expr | Rec [(Var,Expr)]
data AltCon = DEFAULT | LitAlt Lit | DataAlt DataCon
Sanity check on wilder excesses
The Haskell
Gorilla
System FC
Rest of GHC
Haskell users
A smallish,
tolerant,
rather pointy-headed, and
extremely friendly
user-base makes Haskell nimble.
Haskell has evolved rapidly and
continues to do so.
Haskell users react to new features
like hyenas react to red meat
Lesson: avoid success at all costs
The price of usefulness
Libraries increasingly important:
– 1996: Separate libraries Report
– 2001: Hierarchical library naming structure, increasingly
populated
– 2006: Cabal and Hackage: packaging and distribution
infrastructure
Foreign-function interface increasingly important
– 1993 onwards: a variety of experiments
– 2001: successful effort to standardise a FFI across
implementations
Lightweight concurrency, asynchronous
exceptions, bound threads, transactional memory,
data parallelism...
Any language large enough to be
useful becomes dauntingly complex
Conclusion
Haskell does not meet Bjarne’s
criterion (be good enough on all axes)
Instead, like Self, it aspires to take
a few beautiful ideas (esp: purity and
polymorphism), pursue them single-
mindedly, and see how far they can
take us.
In the end, we want to infect your
brain, not your hard drive
Luck
Technical excellence helps, but is neither
necessary nor sufficient for a language
to succeed
Luck, on the other hand, is definitely
necessary
We were certainly lucky: the conditions
that led to Haskell are hard to
reproduce (witness Haskell’)
Fun
Haskell is rich enough to be useful
But above all, Haskell is a language in which
people play
– Programming as an art form
– Embedded domain-specific languages
– Type system hacks
Play leads to new discoveries
Encapsulating it all
data ST s a -- Abstract
newRef :: a -> ST s (STRef s a)
read :: STRef s a -> ST s a
write :: STRef s a -> a -> ST s ()
Stateful
computation Pure result
Security of Monads
encapsulation
depends on
parametricity And that depends on type classes
to make non-parametric
operations explicit
(e.g. f :: Ord a => a -> a)
Parametricity depends on there
being few polymorphic functions
(e.g.. f:: a->a means f is the And it also depends
identity function or bottom) on purity (no side
effects)
The Haskell committee
Arvind Thomas Johnsson
Lennart Augustsson Mark Jones
Dave Barton Dick Kieburtz
Brian Boutel John Launchbury
Warren Burton Erik Meijer
Jon Fairbairn Rishiyur Nikhil
Joseph Fasel John Peterson
Andy Gordon Simon Peyton Jones [editor]
Maria Guzman Mike Reeve
Kevin Hammond Alastair Reid
Ralf Hinze Colin Runciman
Paul Hudak [editor] Philip Wadler [editor]
John Hughes [editor] David Wise
Jonathan Young