CMSC 22610
Implementation of Computer Languages - II
Spring 2009

General Information

Instructor: John Reppy Ryerson 256
By appointment
TA: Mike Rainey Ryerson 257B
Wed. 1:30-3
Lecture: TR 1:30-2:50
Ryerson 277
Mailing list: cmsc22620 'at' mailman 'dot' cs 'dot' uchicago 'dot' edu


This course is a continuation of CMSC 22610 and deals with the optimization and code-generation phases of a compiler. We will cover intermediate representations and basic optimizations, dataflow analysis, instruction selection, and register allocation. There will be light homework and a mid-term exam, but main body of required work will be the course project.

Text books

The main text for the course is
Title: Modern Compiler Implementation in ML
Author: Andrew Appel
Publisher: Cambridge University Press, 1998
The programming assignments will be written using the SML programming language. The following book is one of the better introductions to SML programming.
Title: ML for the Working Programmer (2nd Edition)
Authors: L.C. Paulson
Publisher: Cambridge University Press, 1996
The following reference may also be useful:
Title: The Standard ML Library
Editors: Emden Gansner and John Reppy
Publisher: Cambridge University Press, 2004


Grading for the course will be based on:

Percentage Component
20% Homework assignments
25% Midterm Exam (11/18)
50% Projects
5% Class participation

Homework assignments

Homework is due at the beginning of class and late homework will not be accepted for credit.
Date Assignment Due date
April 9 Homework 1 April 14
April 30 Homework 2 May 5

Course project

The course project is to implement a code generator for LangF, which is a small high-level language. We will provide a front-end that produces a typed abstract-syntax tree representation, as well as various support files. This code will be seeded using SVN repositories on the course gforge server
The target of the code generator is the x86-64 (a.k.a. AMD64) architecture. The Intel-based Macs in the Mac Lab support this instruction set as well as the two departmental Linux machines lhr and cuckoo. The project will be divided into five milestones with the following tentative due dates:
April 10:Project 1 --- translation to LambdaIR
May 1:Project 2 --- basic code generation
May 10:Project 3 --- GC support
May 22:Project 4 --- value numbering
June 5:Project 5 --- register allocation

Project handouts

Project handouts are available online from the following links:
Project overview
Project-1 description [Revised 2009-04-06]
Project-2 description
x86-64 instructions and ABI [Revised 2009-04-26]
Implementing non-local control ▀ow
Project-3 description [Revised 2009-05-07]
Project-4 description


SML Tutorial slides from lecture (pdf)

The Standard ML Basis Library

The SML/NJ Compilation Manager (CM)

Programming in SML'97: An on-line tutorial

Academic Honesty

[The following is due to Stuart Kurtz]

The University of Chicago is a scholarly academic community. You need to both understand and internalize the ethics of our community. A good place to start is with the Cadet's Honor Code of the US Military Academy: "A Cadet will not lie, cheat, or steal, or tolerate those who do." It is important to understand that the notion of property that matters most to academics is ideas, and that to pass someone else's ideas off as your own is to lie, cheat, and steal.

The University has a formal policy on Academic Honesty, which is somewhat more verbose than West Point's. Even so, you should read and understand it.

We believe that student interactions are an important and useful means to mastery of the material. We recommend that you discuss the material in this class with other students, and that includes the homework assignments. So what is the boundary between acceptable collaboration and academic misconduct? First, while it is acceptable to discuss homework, it is not acceptable to turn in someone else's work as your own. When the time comes to write down your answer, you should write it down yourself from your own memory. Moreover, you should cite any material discussions, or written sources, e.g.,

Note: I discussed this exercise with Jane Smith.

The University's policy, for its relative length, says less than it should regarding the culpability of those who know of misconduct by others, but do not report it. An all too common case has been where one student has decided to "help" another student by giving them a copy of their assignment, only to have that other student copy it and turn it in. In such cases, we view both students as culpable and pursue disciplinary sanctions against both.

For the student collaborations, it can be a slippery slope that leads from sanctioned collaboration to outright misconduct. But for all the slipperyness, there is a clear line: present only your ideas as yours and attribute all others.

If you have any questions about what is or is not proper academic conduct, please ask your instructors.

Last revised: May 14, 2009.