COMP 520
Compiler Design
Winter 2016


Professor Laurie Hendren

Tuesday, Thursday, Friday 11:30-12:30
McConnell 103


2016 Contest Winners

Bytecode Peephole Optimizer Challenge
(Ethan Macdonald, Hardik Vala and Teng (Leo) Long)
OncoTime Compiler
(Eric Di Tomasso and Adam Carruthers)


GoLite Compiler Co-Winners
(Frederic Lafrance and Jacob Errington)
GoLite Compiler Co-Winners
(Prabhjot Sandhu, Grady Weber and David Zhou)


Announcements and Schedule

Announcements

Schedule (may change slightly as the term progresses)

Week 0 (Jan 8)
Lecture Topics:
Introduction to the course
Introduction to compilers
Readings:
Chapters 1, 2 and 3, Crafting a Compiler
Introduction slides (with course outline)
Learn github
For those students who have not taken COMP 330, you need to learn the basics of regular expressions/languages and context-free languages. A good online resource may be found here
Milestones:
Start to form groups (3 people per group recommended)
Week 1 (Jan 11-16)
Lecture Topics:
Scanning and Parsing
Readings:
Scanner slides
Chapters 1, 2 and 3, Crafting a Compiler
Parser slides
Chapter 4: 4.1-4.4 recommended; 4.5 optional, Crafting a Compiler
Chapter 5: 5.1-5.2 recommended; 5.3-5.9 optional, Crafting a Compiler
Chapter 6: 6.1, 6.2 and 6.4 recommended; 6.3 and 6.5 optional, Crafting a Compiler
Milestones:
Continue to form groups (3 people per group recommended)
Make sure are comfortable with git
Keep up with readings!
Week 2-3 (Jan 19-29)
Lecture Topics:
Abstract Syntax Trees
OncoTime - Domain Specific Language
GoLite - General Purpose Language
SableCC
Readings:
AST (Part 1) Slides
OncoTime Slides
Go Lecture Slides
AST (Part 2) Slides
AST (Part 3) Slides
Chapter 7: Crafting a Compiler
alternative: Chapter 4: Modern Compiler Design in Java
Milestones:
Add/drop deadline, January 19
Individual warmup assignment #1, January 25
Group formation formalization, January 29
Week 4 (Feb 1-5)
Lecture Topics:
Symbol Table and Type Checking
Readings:
Chapter 8.8, Crafting a Compiler
Milestones:
Individual Warmup Assignment, Part 2, Feb 3
Week 5 (Feb 8-12)
Lecture Topics:
More Symbol Tables
Symbols and Types for the Projects
Readings:
Chapter 8.1-8.7, Crafting a Compiler
Milestones:
No Lecture, Thursday, Feb 11
Week 6 (Feb 15-19)
Lecture Topics:
Finish type checking
Virtual Machines
Readings:
Week 7 (Feb 23-26)
Lecture Topics:
Virtual Machines and Code Generation
Readings:
Milestones:
Friday, Feb 26, Group Scanner, Parser and Weeding,

Study Break

Week 8 (Mar 7-11)
Lecture Topics:
Finish Virtual Machines/Bytecode Generation
Midterm Review
Readings:
Milestones:
Work on Group Symbol Tables and Type Checking
Week 9 (March 14-18)
Lecture Topics:
Code Generation
No class on Thursday
Midterm (Friday)
Milestones:
Midterm, Friday, March 18th
Week 10 (Mar 21-25)
Lecture Topics:
Optimizations
Readings:
Milestones:
Group Type Checking and Symbol Tables, Tuesday, Mar 22
No class on Thursday - take a look at the peephole optimizer and start milestone #3
Good Friday Holiday on Friday
Week 11 (Mar 28-Apr 1)
Lecture Topics:
Garbage Collection and Optimization
Native Code Generation
Readings:
Milestones:
Work on Milestone #3 and peepholes.
Week 12 (Apr 4-8)
Lecture Topics:
Static Analysis
Readings:
Milestones:
Define structure of final report
Group update on code generation, Monday April 4
Peephole patterms, extended to Saturday April 9th at midnight
Week 13 (Apr 11-15)
Lecture Topics:
More Static Analysis and Course recap
Readings:
Milestones:
Milestone #4, Complete Compiler and Final Report, Friday, April 15
No classes (no class on April 15)
Post Weeks (April 18-22 and April 25-29)
Milestones:
Group Presentations to instructor/TA
Final Exams begin April 18
COMP 520 Final Exam: April 27, 6pm

Resource Materials

Version Control Systems

Tiny Language Example (flex/bison, SableCC2 and SableCC3)

Online documentation

Under The Hood articles:

JOOS Example

Go and GoLite

OncoTime (will be updated for 2016)

Previous Years' Home Pages