Compiler Design
Course ID 15611
Description This course covers the design and implementation of compiler and run-time systems for high-level languages, and examines the interaction between language design, compiler design, and run-time organization. Topics covered include syntactic and lexical analysis, handling of user-defined types and type-checking, context analysis, code generation and optimization, and memory management and run-time organization.
Key Topics
structure of a compiler; static and dynamic semantics; compiler correctness; parsing and lexing; semantic analysis; code generation; static single assignment form; dataflow analysis; compiler optimizations; assembly code; register allocation; intermediate representations; automatic memory management
Required Background Knowledge
Students are expected to have significant experience in a high-level programming language such as OCaml, SML, or Rust.
Course Relevance
15-411 is for undergraduate students. Graduate students should enroll in 15-611.
Course Goals
Distinguish the main phases of a state-of-the-art compiler; Understand static and dynamic semantics of an imperative language; Develop parsers and lexers using parser generators and combinators; Perform semantic analysis; Translate abstract syntax trees to intermediate representations and static single assignment form; Analyze the dataflow in an imperative language; Perform standard compiler optimizations; Generate efficient assembly code for a modern architecture; Allocate registers using a graph-coloring algorithm; Understand opportunities and limitations of compiler optimizations; Appreciate design tradeoffs how representation affects optimizations; Automatically manage memory using garbage collection; Develop complex software following high-level specifications
Learning Resources
Github; Ed Discussion; Lecture Notes
Assessment Structure
homework assignments: 30%; labs: 65%; code reviews: 5%
Extra Time Commitment
n/a
Course Link
https://www.cs.cmu.edu/~411/