MacGyver's Haskell Compiler
summary
Builds a working Haskell-to-combinators compiler that converts Haskell AST to lambda terms, uses Scott encoding for data and a fixed‑point (Y combinator) trick for recursion, then applies a bracket‑abstraction algorithm to emit S and K combinators. Runs a tiny VM and a browser demo that evaluates examples (four factorial reduces to 24 in about 1m17s in the demo), includes a reduction visualizer, and publishes the repo; core pipeline works but some features (mutual recursive modules, full pattern matching) remain unfinished.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 2:06Boolean logic to combinators
- 10:16Combinators as building blocks
- 17:23Live demo
- 25:14Compiling to combinators
- 36:46Recursion and Y combinator
- 44:52Bootstrapping and demos
- 52:29Tips and lessons
- 56:13Q&A
related talks
40mAn Introduction to Combinator Compilers and Graph Reduction Machines
42mThe Power of Function Composition
45mFunctional Programming bits and pieces
01h 33mComposition Intuition II
53mIntro to Haskell for Erlangers
01h 01mLive Lambda Calculus
01h 01mFunction Composition in Programming Languages
59mMercury: An Odd Amalgam of Haskell and Prolog - Part 1 of 2
