Office | Office hours | ||
Olin Shivers | WVH 318 | shivers@ccs | TBD & by appt |
Monday | 11:45–1:25 | Ryder 458 |
Thursday | 11:45–1:25 | Ryder 458 |
Course schedule (lectures, projects, exams) (This is the central file for course-related information.)
Piazza: https://piazza.com/class/kt7form1aoq390
Handin server: https://handins.ccs.neu.edu/courses/161
Slides for intro-to-SML lecture.The course textbook is Modern Compiler Implementation in ML, by Andrew Appel. Try to get the edition that says "Reprinted with corrections, 1999" on page iv; previous editions had lots of errors. (This is, of course, not an issue in 2017 unless you're buying a very old, used copy.) You can order the book from Barnes & Noble or Amazon.
Appel's text comes in multiple versions: one for C, Java and ML. Make sure you get the ML version.
Appel maintains a web page for the text book, which includes various files to begin your compiler with, and a a list of errata for the different editions of the book. It will save you confusion later if you take 15 minutes and go through the errata, applying them to your copy.
You can also find some useful tutorials on the Net. Several are listed below.
Appel provides a module of code for the Tiger-compiler project called the "canonicaliser," which lowers a program in the IR language to a form closer to machine code. This code is hard to read, as the invariants of the lowered/canonicalised form are not expressed in the type of the result form. Well, and the code isn't commented, either.
I rewrote this code using a target data type that makes the new form explicit in the type structure. It is much clearer (as well as voluminously commented). It also has a better commutativity analysis.
The code comes in two forms. The first version is exactly as described above. Then I took that, and converted the improved code to use the original IR data type for the target, producing a version that is a drop-in replacement for Appel's code.
So, read the first version but use the second.