SP16: COMPILERS: 11241

High-level programming languages like Scheme make programming a breeze, but how do they work? There's a big gap between Scheme and machine instructions for modern computers. Learn how to translate Racket (a dialect of Scheme) programs all the way to Intel x86 assembly language.

Most compiler courses teach one phase of the compiler at a time, such as parsing, semantic analysis, and register allocation. The problem with that approach is it is difficult to understand how the whole compiler fits together and why each phase is designed the way it is. Instead, each week we implement a successively larger subset of the Racket language and a statically typed version of it. The very first subset is a tiny language of arithmetic statements, and by the time we are done the language includes first-class functions.

Prerequisites: B521 or C311. Fluency in Racket is highly recommended as students will do a lot of programming in Racket. Prior knowledge of an assembly language helps, but is not required.

Textbook: The notes for the course are available here in ShareLatex. If you see a blank screen at first, click on the "recompile" button. Also, you can download a PDF for offline viewing by clicking on the second button to the right of the "recompile" button. If you have suggestions for improvement, please either send an email to Jeremy or, even better, make edits to a branch of the book and perform a pull request. The book is at the following location on github:

  http://github.com/jsiek/Essentials-of-Compilation

Lecture: Monday and Wednesday, 2:30pm to 3:45pm, in AD A151. The classroom is in the IU Auditorium Building. Enter on the south side, near the sign that says "Lee Norvelle Theatre & Drama Center". Go up a half-flight of stairs and the classroom is on the left.

Office hours:

  • Michael Vitousek (mvitouse): Tuesdays and Thursdays 1:30pm to 3:30pm in LH 035.
  • Carl Factora (cfactora): Mondays and Wednesdays 12:15pm to 2:15pm in LH 035.
  • Jeremy Siek (jsiek): Mondays 4-5pm, Friday's 1pm to 2pm, in LH 230D.

Topics:

  • Instruction Selection
  • Register Allocation
  • Static type checking
  • Conditional control flow
  • Mutable data
  • Garbage collection
  • Procedures and calling conventions
  • First-class functions and closure conversion
  • Dynamic typing
  • Generics
  • High-level optimization (inlining, constant folding, copy propagation, etc.)

Grading:

  • Participation 14%
    • Class attendance
    • Piazza questions and answers
    • Office hours attendance
  • Assignments 57%
  • Midterm Exam (in class) 29%

Assignments:

Assignments will be due weekly on Mondays at 11:59pm. You will turn in your assignment by creating a github at IU repository and giving access to Michael Vitousek (if you are a graduate student) or to Carl Factora (if you are an undergraduate students). Assignments will be graded based on how many test cases they pass. The test suite used for grading will be made available on Sunday night, one day prior to the due date. The testing will be done on the silo machine (linux). The testing will include both new tests and all of the tests from prior assignments. Assignments may be turned in up to one week late with a penalty of one letter grade.

Email Discussion Group: on Piazza

Resources:

Course Summary:

Date Details Due