Into the Core - Squeezing Haskell into Nine Constructors by Simon Peyton Jones
HTML-код
- Опубликовано: 17 окт 2024
- Keynote talk from Erlang USer Conference 2016 www.erlang-fact...
Erlang and Haskell are childhood friends who grew up together. Throughout the years, they have learnt a lot from each other. And just because they have become adults does not mean the learning stops.
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 I’ll take you on a journey into Core and its design choices. I’ll sketch Core’s type system, and the optimisations that GHC implements in Core, including let-floating, strictness analysis, specialisation, inlining, and 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.
14:48 "I just wanted to build a sweaty compiler."
- Simon Peyton Jones, 2016
"Immutability changes everything"
me, an intellectual with a sense of humor: *exhales audibly through my nose*
translation for regular people: "not being able to change anything changes everything"
I watched this video last year, after just completing a master level course about functional programming. I should've been as ready as I ever would be to understand this and I didn't. Yet, exactly one year later it suddenly all clicks! Feeling very satisfied.
SPJ is an incredibly gifted speaker. I'm the #1 SPJ fangirl. The crowd oughta be screaming "INLINING!!!" along with him.
Whoever had the bright idea to zoom the camera out at 56:24…your camera direction is not appreciated.
added Simon Peyton Jones to the list of my heroes
SIMON PEYTON JONES!
Is there a version where we can see the slides more clearly?
On the website linked in the description, if you click on Simon's picture, you can find a PDF of the slides
They are here: www.erlang-factory.com/static/upload/media/1488806820775921euc2016intothecoresimonpeytonjones.pdf
8:08 it's like he's about to say "BUT IT AIN'T RAGHT"
this makes a lot of sense and i see this too in Elixir where much of the language desugars to a very minimal API surface. it’s one of the things that make elixir a joy to program in.
Erlang doesn't have null? Why?
I was actually thinking of making a (toy) language that targets core!
He's very enthusiastic and I like it
Not able to see the slides
On the website linked in the description, if you click on Simon's picture, you can find a PDF of the slides
www.erlang-factory.com/static/upload/media/1488806820775921euc2016intothecoresimonpeytonjones.pdf
Slides please.
Enthusiastic presentation, thank you ! Otherwise I think it would have become boring for me :)
Wait isn't LLVM also a statically typed IR?
It is, although it is far less useful in LLVM IR because there most things are statements, for which it is much easier to do transformations that are wrong but type correct than in Core where most things are expressions.
He *always* uses Comic Sans for his presentations. What a troll 😄
he definitely is not a front-end developer ^^
How I wish the slides could look bigger
What's a lambda?
a function.
ps: that's not the whole story but sufficient for a start.
Simon Peyton Jones right next to Isaac Newton
inlining ftw..
storm in a glass
I just use this to not kill myself when writing MATLAB instead of heroin.
How the fuck do I do manual zoom to see the slides if I'm watching this on RUclips. Get it right already, it's 2016, and you people are programmers.
I use the Accessibility > Zoom in OSX for videos like this and for CodeMesh talks. Unfortunately, the resolution is too low on this video to work at the end.
Not sure if the example is identical at the end, but this paper covers it in sections 4.2 & 4.3
www.microsoft.com/en-us/research/wp-content/uploads/2016/04/sequent-calculus-icfp16.pdf
slides here: www.erlang-factory.com/static/upload/media/1488806820775921euc2016intothecoresimonpeytonjones.pdf
it's wild how one of the smartest guys in programming has some of the worst taste in slide aesthetics.