15-417/617/817 HOT Compilation

Spring 2025
Frank Pfenning
TuTh 12:30-1:50
PH A18C
12 units

This course covers the implementation of compilers for higher-order typed languages such as ML and Haskell and gives an introduction to type-preserving compilation. Core topics include type checking and inference, elaboration, closure conversion, garbage collection, and translation to a low-level imperative language.

This instance of the course will focus on substructural (for example, linear or affine) and adjoint type systems, and how to take advantage of such types in a compiler and runtime system. Another topic will be data layout from a type system perspective.

Students will implement a succession of end-to-end compilers for increasingly expressive languages, with the last project providing some leeway. They will have the option to work solo or with a partner, and some options regarding the implementation language will also be available.

The course is cross-listed at the undergraduate and graduate levels and intended to be interesting and challenging at all levels. For undergraduates, 15-312 is recommended as a prerequisite, for graduate students 15-814.

Here are two AI-generated podcasts regarding the research underlying the specific topics of emphasis in this course this year that you might find interesting. Each of them was given two papers as the only input.


Prior Versions of This Course

Class Material

Schedule Lecture notes and additional readings
Assignments Assignment due dates
Resources Links to other resources

Course Information

Lectures Tue Thu 12:30-1:50, PH A18C
Office Hours TBA
Course Communication TBA
Notes There is no textbook, but lecture notes and papers will be posted
Credit 12 units
Grading 100% Projects
Assignments Biweekly projects will be assigned
Details TBA
Exams There will be no exams
Home http://www.cs.cmu.edu/~fp/courses/15417-s25/

Learning objectives: After taking this course, students will be able to

  • implement a functional language
  • implement a substructural type system
  • implement data layout strategies
These skills require a deep understanding of the underlying principles of language and type system design.

Topics: Many of these topics are tentative, depending on the pace of the course and participant interests.

  • Substructural types
  • Bidirectional type checking
  • Subtyping equirecursive types
  • Adjoint types and mode inference
  • Ad hoc polymorphism
  • Destination-passing style and semi-axiomatic sequent calculus
  • Data layout via positive cuts and snips
  • Closure conversion and contextual modal types
  • Substructural pattern matching via focusing
  • Substructural operational semantics
  • Garbage collection in a substructural language
  • Static memory reuse
Even more tentative:
  • Stack allocation via a Kripke semantics
  • Calling conventions via negative cuts and snips
  • Parametric polymorphism and type inference
  • Futures
  • Ordered types


[ Home | Schedule | Assignments | Resources ]

fp@cs
Frank Pfenning