The Compilers course is taught jointly by Paul Kelly and Naranker Dulay. This web page describes Paul Kelly’s half of the course, which is primarily on code generation and optimisation.

This page provides your guide to how the course is structured and delivered. It is your first stop for understanding what you need to do to succeed as a student.

For 2022-23 the course will be delivered as a combination of the following elements:

  • Pre-recorded lectures (based on slides: Paul's, and Naranker's

  • Tutorial problems: come to the live class having already completed, or at least attempted, the relevant tutorial

  • Live classes, timetabled for up to two hours per week (each week one hour with Paul Kelly, one hour with Naranker Dulay).

  • One short assessed coursework exercise on code generation

You should budget 3-6 hours per week to watch the videos, study the associated slides, and complete the related tutorial exercises.

The timetabled live classes will be used for:

  • Q&A on the prerecorded material. It would be helpful if you would post your questions on EdStem the day before the class.

  • Tutorial problems

  • Exam preparation


  • Lecture slides and other course materials are available online - here for Paul's, here for Naranker's.

  • Prerecorded lecture videos are available on Panopto here

  • Recorded timetabled classes will probably be also be posted on Panopto here, though there is no guarantee that every session will successfully be recorded.

  • The primary vehicle for your questions will be EdStem here

What to do when:

  • A schedule of what you need to do in preparation for each of Paul's lectures is provided on the DoC “Scientia” website here.

Course structure

  • Ch1: Introduction
  • Ch2: Introduction to syntax analysis – and a complete toy compiler
  • Ch3: Code generation
  • Ch4: Generating better code by using registers
  • Ch5: Register allocation
  • Ch6: Optimisation and data flow analysis
  • Ch7: Loop optimisations

Details of Naranker Dulay’s half of the course can be found here. The teaching for the two halves will be interleaved:

  • Part 1: Lexical Analysis
  • Part 2: LR Bottom-up Parsing
  • Part 3: LL Top-down Parsing
  • Part 4: Semantics
  • Part 5: Runtime Organisation

Students from other departments at Imperial College:

  • If you are a a visiting, external or exchange student, or based in another department at Imperial, it is essential that you register as early as possible for the course via this link.

The course catalogue entry for this course is 50006.