sdiehl/write-you-a-haskell
sdiehl/write-you-a-haskell has 3,490 GitHub stars and 258 forks. GitHot measured +1 stars in 24 hours. Last checked 2026-11-06 18:32 UTC. Last push 2026-10-28.
Building a modern functional compiler from first principles.
Measured star growth
- in 24h
- +1
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original
Building a modern functional compiler from first principles.
Read Online:
Chapters
- Chapter 1: Introduction
- Chapter 2: Parsing (Code)
- Chapter 3: Lambda Calculus (Code)
- Chapter 4: Simply Typed Lambda Calculus (Code)
- Chapter 5: Evaluation (Code)
- Chapter 6: Hindley-Milner Inference (Code)
- Chapter 7: Design of Fun (Code)
- Chapter 8: Layout and the Extended Parser (Code)
- Chapter 9: The Renamer (Code)
- Chapter 10: Typed Core and Core Lint (Code)
- Chapter 11: Datatypes and Pattern Matching (Code)
- Chapter 12: Records (Code)
- Chapter 13: Kinds and Type Constructors (Code)
- Chapter 14: Type Classes (Code)
- Chapter 15: Monads, Do Notation and IO (Code)
- Chapter 16: Pattern-Match Compilation (Code)
- Chapter 17: The Prelude and Deriving (Code)
- Chapter 18: A-Normal Form and Join Points (Code)
- Chapter 19: Closure Conversion (Code)
- Chapter 20: Data Representation and the Runtime (Code)
- Chapter 21: LLVM Code Generation (Code)
- Chapter 22: JIT and the REPL (Code)
- Chapter 23: Optimization (Code)
- Chapter 24: A Precise Garbage Collector (Code)
- Chapter 25: Future Work
Building
To build the chapters and the book, install Rust, just, Boehm GC and LLVM 22.
The pinned book tools are installed locally by just bootstrap.
$ just bootstrap
$ just build
$ just book
To generate the pdf:
$ just pdf
Contributing
Any and all contributions are always welcome. As always, I rely on the perpetual kindness and goodwill of other compiler nerds (like you!) to help correct grammar, clarify, and fix errors.
License

This written work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. You may reproduce and edit this work with attribution.
The included source is released under the terms of the MIT License.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,616 starspublic-apis/public-apis
A collective list of free APIs
496,872 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
439,545 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,104 stars