CS 426 — Programming Projects
Fall 2025
The overall semester project is to build a compiler for the COOL programming language, an imperative, object-oriented, type-safe language that is a model of the Java language. You will be compiling COOL down to the LLVM virtual instruction set, which is the Internal Representation for the LLVM compiler infrastructure. You will also write some dataflow optimizations on the LLVM IR. 1-unit students (see the Home page for a formal definition!) will also do a “back-end” project, related to machine code generation. Your project will be written in C++.
The programming guides and other documentation you will need for this project are available on the Resources page. To allow you to focus on the “interesting” issues, we will give you several components including:
- Data structures for an Abstract Syntax Tree (AST) for COOL.
- A type checker for the COOL language because type checking is not a topic of this class. It was covered in CS 421, a prerequisite, and you should be familiar with the basic concepts of it.
- Data structures and some passes for the LLVM Internal Representation (IR).
- All the back end code generation facilities for LLVM.
Your (common) project will be divided into 4 or 5 parts:
- Scanner and Parser: Translate COOL programs into the COOL AST.
- Intermediate Code Generation 1: “Lower” the COOL AST to LLVM for non-object-oriented features.
- Intermediate Code Generation 2: Add object-oriented features such as static/virtual method dispatch, type conversion, and some run-time checks.
- Back-End Code Generation: Write a target-independent graph-coloring register allocator pass for LLVM, parameterized by a target machine description.
- Dataflow Optimizations(Unit Project): 2–3 optimizations on the LLVM IR.
Project Details
-
MP1
- Release Date: September 2, 2025
- Due Date: September 16, 2025
-
MP2
- Release Date: October 2, 2025
- Due Date: October 23, 2025
-
MP3
- Release Date: October 26, 2025
- Due Date: November 17, 2025
-
MP4
- Release Date: November 17, 2025
- Due Date: December 8, 2025
-
Unit Project
- Release Date: November 17, 2025
- Due Date: December 14, 2025