General Information

Instructor:

John Reppy

jhr@cs.uchicago.edu.

TA:

Byron Zhong

Lectures:

TR 15:30-16:50

Ryerson 276

Recitations:

W 16:30-17:20

Rosenwald 011

Course Description

A vast majority of computer programs must deal with textual input of some form or another. This input can range from simple configuration languages to data description languages (e.g., XML) to scripting languages to full-blown programming languages. In this course, we cover the tools and techniques used to process the full range of computer languages (i.e., languages that specify programs and data on computers). Topics include scanning and parsing, tree representations of structured input, simple typechecking, translation between intermediate forms, code generation and optimization, and some run-time system issues. This course is a project oriented course in which students will construct a fully working compiler for a small programming language. We use Standard ML (SML) as the primary implementation language for the programming projects.

It is expected that you comfortable with functional (e.g., as covered in either CMSC 22100, CMSC 22300, or CMSC 22311) and that you have taken CMSC 15400 (Introduction to Computer Systems).

Lectures

The topics that the class covers are organized into eight modules, with a varying number of lectures per module.

  1. Course introduction and overview (1 lecture)

  2. Scanning (2-3 lectures)

  3. Parsing (3-4 lectures)

  4. Checking Static Semantics (2 lectures)

  5. Intermediate Representations (1-2 lectures)

  6. Program Analysis (2 lectures)

  7. Optimization (2-3 lectures)

  8. Code Generation and Runtime Systems (2 lectures)

Recitations

There is a scheduled recitation on Wednesdays starting at 4:30pm (location TBA). We use these recitations to provide additional information that is useful for the course project. You are expected to attend recitation and are responsible for the material covered in recitation.

Office Hours

We have scheduled in-person office hours Mondays and Fridays.

Weekday Time Host and Location

Monday

11:00-12:00

John Reppy (JCL 253)

Friday

13:30-14:30

Byron Zhong (JCL 236)

You may also schedule a meeting (either in-person or via Zoom) with the instructor by sending email to jhr@cs.uchicago.edu.

Course Project

The project for the course is to implement a small functional programming language, called ML Lite. In addition, there will be a small programming assignment (aka Project 0) to get you started with SML programming.

The project grade will comprise the bulk of your course grade, and will involve a significant effort to complete, so it is important that you give it sufficient time and effort. The main project is divided into four parts. Because the seed code for each part includes a solution for the previous parts, we do not accept late submissions or give extensions, but you should have ample time to complete the assignments (as long as you do not leave them to the last minute).

The tentative due dates for the programming projects are as follows:

Post Date Description Due Date

09/30

Project 0 — Capture-Free Substitution

10/08

10/05

Project 1 — Scanning

10/14

10/15

Project 2 — Parsing and Binding Analysis

10/28

10/29

Project 3 — Type Checking

11/15

11/16

Project 4 — Optimization and Code Generation

12/9

Projects will be due at 23:59 (Chicago time) on their due date.

Project Documents

The project description and other documents will be posted here.

Standard ML

As mentioned above, we use the Standard ML language for the programming projects in this course. Standard ML (usually refered to as SML) is a strict functional programming language with a long history an a number of implementations. For this course, we use Version 110.99.1 of the Standard ML of New Jersey (SML/NJ) system. This software is open source and supports Intel/AMD processors running Linux (32 and 64-bit), macOS (32 and 64-bit), and Windows (32-bit).

Note

While it will be possible to develop the first three parts of the course project on Windows, the last part requires either Linux or macOS running a 64-bit system.

Textbooks

We do not require a textbook for this class, but we recommend the following if you are looking for a source of additional information.

  • Modern Compiler Implementation in ML, by Andrew Appel. Cambridge University Press, 1998.
    This book is a good overview of compilers that uses SML as its implementation language (there are also versions for C and Java).

  • ML for the Working Programmer (2nd Ed.), by L.C. Paulson, Cambridge University Press, 1996.
    This book is one of the better introductions to programming with SML.

Online Resources

SML Tutorials

There are a number of online SML tutorials. We recommend the following:

SML Documentation

LLVM Documentation

The last part of the project will use the LLVM toolchain to produce machine code that can be executed.

Academic Honesty

Note

The following discussion is owed 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.

COVID-19 Policies

UChicago Health Pact

All students on campus are required to adhere to the guidelines in the UChicago Health Pact in order to promote a safe environment in the classroom.

Unvaccinated and fully vaccinated individuals are required to wear a face covering over the nose and the mouth at all times while in University buildings (except when eating or in a private space). Do not attend class if you feel unwell or are experiencing COVID-19 related symptoms The complete text of the UChicago Health Pact along with additional information about COVID-19 protocols can be found here.

Any concerns over inappropriate PPE usage, physical distancing, cleaning/disinfection, or other COVID-19 related public health concerns should be directed to UCAIR.

If there is an emergency, call 773-702-8181 or dial 123 on any campus phone.

Reporting COVID-19 Exposure or a Confirmed Case

If you were potentially exposed to COVID-19 or your COVID-19 test results come back positive, reach out immediately to C19HealthReport@uchicago.edu.