8.7

EECS 483: Compiler Construction

Syllabus --Fall 2022

Meeting places & times

Course staff & office hours

Instructor

  

Max New

  

maxsnew@umich

  

Beyster 4640 & Zoom

  

Tue & Wed 3:30-5:00pm (hybrid),
and by appointment

GSI:

  

Mikhail Sashko

  

msashko@umich

  

Zoom
Beyster Atrium

  

Tue 12:00-2:00p (Virtual)
Fri 2:00-4:00pm (In-person)

IA

  

Ethan Burt

  

burteth@umich

  

Zoom

  

Thu 5:00-6:00pm (Virtual)

Max New
Max New

Mikhail Sashko
Mikhail Sashko

Ethan Burt
Ethan Burt


General information

EECS 483 covers the implementation of efficient compilers for programming languages. The course focuses on the connections between language features and the impact they have on the design of a compilier, including any associated algorithms and pragmatic issues, and practical applications including those outside of programming languages proper. Participants build a working compiler including lexical analysis, parsing, register allocation and code generation. As a secondary emphasis, the course exposes students to run-time issues and optimization.

Exams

There will be no formal exams in this course. However, we will have one or two written assignments (as opposed to the programming assignments) that will serve a similar purpose. There is a final exam time scheduled for this course, but we may not use it.


External Links

This is the main website for this course. We will also use the following sites:


Materials

Software

Programming assignments will use several pieces of software:

Rust is supported by many editors you may use any editor you wish.

Compilers written in the class will be graded on Linux, and code is not cross-platform. I will provide pointers to how Mac users can easily make their code work on Linux, but Windows users are recommended to install a Linux distribution using WSL for testing. Instructions are provided here.

Books

There is no required textbook, but you may find these books useful.


Andrew Appel, Modern Compiler Implementation in ML, Cambridge University Press, 1998.

  


Keith D. Cooper and Linda Torczon, Engineering a Compiler, 2nd Ed., Morgan Kaufmann, 2004.

  


Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman, Compilers: Principles, Techniques, and Tools, Pearson Education Inc, 2006.

Online resources

Rust Resources

X86 Resources

X64 Resources

(I will add to this list over the semester as I find useful guides. Email me if you have suggestions.)


Lectures

This table specifies the lecture schedule; topics are tentative.

Date

 

Topics (tentative and approximate)

 

Materials

8/29 M

 

Introduction to compilers, course overview

 

Reading: Rust book chapters 1-4 and notes

8/31 W

 

Rust practice, trees

 

Reading: Rust book chapters 6.2, 8.1,8.2, 9, 10.3, 11, Rust live code and slides

9/05 M

 

No class: Labor Day

 

9/07 W

 

Our first compiler: grammar, abstract syntax, and x86

 

notes, live code stub.rs and live code main.rs

9/12 M

 

NO CLASS - rescheduled to Friday

 

9/14 W

 

Names, scope and (simple) stacks

 

notes, slides and code

9/16 F

 

(Online) Conditionals

 

notes and 

9/19 M

 

(Online) Sequential Form

 

notes

9/21 W

 

Multiple data types and tagging values

 

notes

9/26 M

 

Errors, Calling into Rust

 

notes

9/28 W

 

Functions Part I: Tail Calls

 

notes

10/03 M

 

Desugaring Mutable Variables and Loops

 

10/05 W

 

Functions Part II: Non-tail Calls

 

slides and notes

10/10 M

 

Heap allocation

 

notes

10/12 W

 

Lambda Lifting

 

In-class code/examples

10/17 M

 

No class: Fall Study Break

 

10/19 W

 

Mutable Arrays and Desugaring

 

notes

10/24 M

 

First-class functions/Closures

 

notes

10/26 W

 

Desugaring Mutual Recursion

 

in-class examples

10/31 M

 

Register Allocation 1: Liveness/Conflict Analysis

 

slides

11/02 W

 

Register Allocation 2: Graph Coloring

 

slides

11/07 M

 

Program Analysis & Optimization

 

11/09 W

 

Frontend Overview, Regular Expressions

 

11/14 M

 

NFAs/DFAs, Lexing

 

slides

11/16 W

 

Context-free Grammars

 

slides

11/21 M

 

Predictive Parsing and LL(1)

 

11/23 W

 

No class: Thanksgiving

 

11/28 M

 

Bottom-Up/Shift-Reduce Parsing

 

11/30 W

 

SLR(1) and LR(1)

 

12/05 M

 

Type Systems

 

12/07 W

 

Compiler Correctness and Verification

 


Testing

Testing your code is sufficiently important that we’ve devoted an entire page to it. Please read these notes, for each and every assignment you work on.


Homework schedule

Homework will usually be due at 5:00 PM on Fridays, but may vary on each individual assignment, so be sure to check the page every time. General homework policies are here.

Link

  

Assigned

  

Due

Assignment 0: Rust warmup and ASTs

  

Thu 09/01

  

Fri 09/09

Assignment 1: Adder: A starter language

  

Wed 09/14

  

Fri 09/23

Assignment 2: Boa: Adding new operators

  

Fri 09/23

  

Fri 09/30

Assignment 3: Cobra: Multiple types of values

  

Fri 09/30

  

Fri 10/14

Assignment 4: Diamondback: Defining functions

  

Tue 10/18

  

Sun 10/30

Assignment 5: Egg-eater: Heap Allocation

  

Mon 10/31

  

Fri 11/11

Assignment 6: Fer-de-lance: Register Allocation

  

Fri 11/11

  

Sun 11/20

Assignment 7: Garter: Design Your Own Language Extension

  

Fri 11/18

  

Part 1 Fri 12/02 Part 2 Wed 12/14


Course policies

Collaboration and academic integrity

Programming assignments may be completed with a partner or solo. To make grading/presentation time manageable, the written assignment and the final project must be completed with a partner. Discuss with the professor if you have a very strong reason it is not possible to work with a partner (personal preference is not a strong reason).

You must collaborate with your assigned partner or team, as specified, on homework assignments. You may request help from any staff member on homework. (When you are working with a partner, we strongly recommend that you request help with your partner, rather than solo.) You may use the Piazza bulletin board to ask questions regarding assignments, so long as your questions (and answers) do not reveal information regarding solutions. You may not get any help from anyone else on a homework assignment; all material submitted must be your own. If in doubt, ask a member of the course staff.

Providing illicit help to another student is also cheating, and will be punished the same as receiving illicit help. It is your responsibility to safeguard your own work.

Students who cheat will be reported to the university’s office on academic integrity and penalized by the course staff, at our discretion, up to and including failing the course.

If you are unclear on any of these policies, please ask a member of the course staff.

Homework

We will be using the following gradescope page for homework submissions.

Late days & late work

Homework will (typically) be due Friday at 5pm. Late work will be accepted until Sunday at 11:59pm but with 10% docked from the grade. After that, late submissions will not be accepted.

Grades

Your grade will be based on your performance on the programming assignments and written assignments. Each assignment will be given an equal weight to the final grade, except for the final project will count for twice as much as a typical assignment. This works out to each assignment being worth 11% of your total grade, with the two portions of the final project being worth 11% each.

The grades will computed on an absolute basis: there will be no overall curving. The instructor may choose to curve an individual assignment, but please do not bank on such a chance.

The estimated mapping of raw point totals to letter grades is given below. Please note that these grade boundaries may move slightly in either direction at the discretion of the instructor: if a particular breakpoint falls in the middle of a tight cluster of numeric grades, we will attempt to move the breakpoint to give that whole cluster the same letter grade. If, near the end of the semester, you are concerned that your grade is hovering near a breakpoint, see me to discuss your concerns.

Cutoff

  

98%

  

93%

  

90%

  

86%

  

83%

  

80%

  

76%

  

73%

  

70%

  

66%

  

63%

  

60%

  

else

Letter grade

  

A+

  

A

  

A-

  

B+

  

B

  

B-

  

C+

  

C

  

C-

  

D+

  

D

  

D-

  

F