CC: Compiler Construction

Course: 21025 Compiler Construction (Spring 2019)
Lecturer:Prof. Oscar Nierstrasz, Dr. Mohammad Ghafari
Assistants:Manuel Leuenberger, Rathesan (Radi) Iyadurai
Audience:Master students in computer science
Lecture:Fridays, 10h15 - 12h00
Exercises:Fridays, 12h00 - 12h45
Place:Engehaldenstrasse 8, 001
Start:Feb 22, 2019
Repetition:NA

St George

Summary

This course will provide students with an introduction to modern compiler construction. The first two-thirds of the course will cover fundamental topics, and will be based on the text book Modern Compiler Implementation in Java (Second edition), Cambridge University Press, New York, NY, USA, 2002, by Andrew W. Appel, with Jens Palsberg). The remaining third of the course covers advanced topics of current interest.

Learning Outcomes

On successful completion of this course, you will be able to:

  • Distinguish formal and practical properties of different approaches to parsing
  • Understand and implement various techniques to parse source code
  • Implement a basic compiler
  • Use visitors to process an abstract syntax tree (AST)
  • Transform an AST to intermediate representation (IR)
  • Perform peephole optimization on the IR
  • Generate target code (eg Java bytecode) from IR

Grading

The final grade will be based 10% on exercises, 30% on a team project and 60% on the final exam.

Schedule 2019

Week Date Lecture Exercises
1 22-Feb-19 Introduction Assignment 1
2 01-Mar-19 Lexical Analysis Assignment 2
3 08-Mar-19 Parsing Assignment 3
4 15-Mar-19 Parsing in Practice Project 1 ZIP
5 22-Mar-19 Intermediate Representation
6 29-Mar-19 Optimization Project 2 ZIP
7 05-Apr-19 Code Generation
8 12-Apr-19 Bytecode and Virtual Machines Project 3 ZIP
- 19-Apr-19 Good Friday
- 26-Apr-19 Spring break
9 03-May-19 PEGs, Packrats and Parser Combinators (Jan Kurš)
10 10-May-19 Truffle — a language implementation framework (Boris Spasojević)
11 17-May-19 Program Transformation
12 24-May-19 Compiling R — a case study (Olivier Flückiger)
13 31-May-19 Final Exam

NB: The lecture notes are based partly on similar courses offered by Profs. Jens Palsberg (CS132) and Tony Hosking (CS502).

Last changed by oscar on 31 May 2019