Stanford CS143: Compilers
Descriptions
- Offered by: Stanford University
- Prerequisites: CS106B (Data Structures), CS107 (Computer Organization) or equivalent
- Programming Language: C++
- Difficulty: 🌟🌟🌟🌟
- Website: web.stanford.edu/class/cs143/
Stanford CS143 is Stanford's compiler course, one of the best in the world. You implement a complete compiler in C++ targeting COOL (Classroom Object-Oriented Language), a teaching language.
The course covers the complete compiler pipeline: lexical analysis, parsing, semantic analysis, intermediate code generation, optimization, and code generation.
Course Resources
- Website: web.stanford.edu/class/cs143/
- Lectures: YouTube
- Assignments: 4 compiler projects (lexer, parser, semantic analyzer, code generator)
Course Features
- Complete compiler implementation: Build a complete compiler from scratch
- COOL language: A teaching language designed to be simple yet cover all core concepts
- 4 programming projects: Each implements one compiler phase, combined into a complete compiler
Self-Study Tips
Learn C++ basics first. The course uses C++; familiarity with OOP is required.
Complete all 4 projects in order. Each depends on the previous; you can't skip ahead.
Read the provided course materials. The course website provides detailed readings essential for understanding the theory.
Notes
CS143 is one of the best courses for getting started with compilers. After completing it, you'll understand how compilers for any programming language work.