Compiler Design

Course ID 15411

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.

Course Relevance
15-411 Lecture 2 Section R is reserved for students who are unable to register for an in-person section due to a government visa/travel restriction or a documented medical condition. Enrollment in this section will require university-level approval. Register for an in-person section unless you are absolutely certain when you register that you will not be able to attend in-person this Fall.

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; Piazza; Optional text

Assessment Structure
set of homework assignments: 30%; labs: 70%

Course Link
https://www.cs.cmu.edu/~janh/courses/411/23/index.html