Erlang and Haskell are childhood friends who grew up together. Throughout the years, they took a lot from each other.
GHC translates all of Haskell into a tiny but super-expressive intermediate language called Core, does a lot of optimisations on Core, and then generates executable code. Core is statically typed, making GHC one of the very few production compilers that is statically typed all the way through to code generation. It pulls off this trick by drawing directly on System F, a mathematical calculus from type theory. Functional programming is amazing: serious theory leads directly to beautiful implementations.
In this talk Simon Peyton Jones will take you on a journey into Core and its design choices.
You will learn about:
- Core’s type system,
- the optimisations that GHC implements in Core, including
- strictness analysis,
- the case-of-case transformation.
Haskell and Erlang are both functional languages, albeit with significant differences (strict vs lazy, untyped vs typed). I hope that the talk may lead to dialogue about how these similarities and differences show up in a compiler.
About the speaker:
Simon Peyton Jones is a British computer scientist who researches the implementation and applications of functional programming languages, particularly lazy functional programming. He is an honorary Professor of Computer Science at the University of Glasgow and co-supervises PhD students at the University of Cambridge.