Lectures are Tuesday 11:45–1:25 and Thursday 2:50–4:30,
Course schedule (lectures, projects, exams)
Slides for intro-to-SML lecture.
- Class web page:
- Class piazza page:
- Lexer (due Tue 2/2)
- Parser (due Thu 2/11 2:50pm)
- Static semantics (due Thu 3/1)
- Frame analysis (unofficially due Tue 3/8)
- Translation to IR (due Thu 3/22)
- Instruction selection (due Thu 3/29)
- Live-variable Data-flow analyser (due Thu 4/5)
- Register allocation (due Thu 4/19)
- Integration (due Thu 4/26)
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 2015
unless you're buying a very old, used copy.)
You can order the book from
Barnes & Noble
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.
- If you are not an experienced SML programmer, then you will
almost certainly need to get an introductory text on SML.
I recommend Larry Paulson's
ML for the Working Programmer.
You can also find some useful tutorials on the Net. Several
are listed below.
MIPS and SPIM
SPIM is a simulator written by James Larus for the MIPS-II ISA,
a real-world processor architecture that is a very clean RISC design.
- James Larus's Assemblers, Linkers, and the SPIM simulator .
This is Appendix B of Hennessy & Patterson's standard architecture
Computer Organization and Design: The Hardware/Software
Interface, published by Morgan Kaufman. (It's appendix A of
older versions of the book). It includes
documentation on the MIPS R2000, its assembly code, and the SPIM
- SPIM documentation, in PostScript and
PDF format. NOTE: the description
of MIPS calling conventions in here is older than that in the Hennessy
& Patterson book.
- The SPIM simulator runs on Windows, Macs and Linux. It has
its own wikipedia page,
which provides links to places you can obtain it. But most linux
distros provide it as a package.
- Tiger Runtime System -- needed to
actually run your programs.