Write You a Haskell is a comprehensive educational book that teaches compiler construction by building a modern functional compiler from first principles.
The book addresses the challenge of understanding how compilers work by guiding readers through the complete implementation of a functional language. It starts with foundational concepts like parsing and lambda calculus, then progressively builds toward a full compiler pipeline. The approach combines theoretical grounding in type systems and formal semantics with practical implementation details, covering Hindley-Milner type inference, pattern matching compilation, closure conversion, and code generation targeting LLVM.
This resource suits developers who want deep knowledge of compiler internals rather than a quick reference. It works best for those comfortable with functional programming concepts and willing to engage with both theory and implementation across multiple chapters. The book progresses from simple interpreters through increasingly sophisticated compiler stages, making it suitable for self-study or as supplementary material for a programming languages course. Unlike quick tutorials, the project provides exhaustive coverage of production compiler concerns including garbage collection, optimization, and runtime design.
The project maintains a stable, complete curriculum with all chapters published and accessible in both HTML and PDF formats. The build system requires Rust, LLVM, and Boehm GC, indicating the material includes working code examples that readers can compile and experiment with locally. The repository accepts contributions, suggesting ongoing refinement of the educational content.