Skip to main content

Compilers:  2025-2026

Lecturer

Degrees

Schedule A1(CS&P)Computer Science and Philosophy

Part A CoreComputer Science

Schedule A1(M&CS)Mathematics and Computer Science

Term

Overview

This course aims to give a simple but practical account of the programming techniques used in implementing high-level programming languages by compiling into code for stack- and register-based machines. The course will include elements in an implementation, written in Scala, of an interpreter and compiler for a simplified version of C.

Learning outcomes

On completion, the students should be able to:

  • Understand and explain the main techniques and algorithms used in compilers.
  • Describe the structures used to represent constructs in typical programming languages.
  • Use compiler construction tools to build a simple compiler.

Synopsis

  • Introduction.
  • Regular expressions and context free grammars as ways of specifying concrete syntax.
  • Bottom-up and top-down parsing.
  • Intermediate representations: abstract syntax trees, stack machines, register machines, control-flow graphs, intermediate code and SSA form.
  • Simple optimisation of intermediate code.
  • Translation from intermediate code to assembly: instruction selection and register allocation.

Syllabus

Programming language representation: concrete and abstract syntax, context-free grammars. Top-down and bottom-up parsing algorithms. Intermediate code generation with simple optimisation. Implementing procedures: passing parameters, local and non-local variables. Abstract machines and storage management: activation records, stacks and heaps.

Reading list

Main Text

  • K Cooper and L Torczon. Engineering A Compiler, 3rd edition, Elsevier Morgan Kaufmann Publishers Inc., 2022
  • Draft of book on Compilers by J.M. Spivey will be available at the start of the course.

Further Reading

  • A V Aho, R Sethi and J D Ullman, Compilers: principles, techniques and tools, 3rd edition, Addison-Wesley.
  • A W Appel, Modern Compiler Implementation in ML, Cambridge University Press.
  • H Abelson and G J Sussman, Structure and Interpretation of Computer Programs, MIT Press, 2nd Edition, 1996.
  • R Bornat, Understanding and writing compilers, available on the web.

Taking our courses

This form is not to be used by students studying for a degree in the Department of Computer Science, or for Visiting Students who are registered for Computer Science courses

Other matriculated University of Oxford students who are interested in taking this, or other, courses in the Department of Computer Science, must complete this online form by 17.00 on Friday of 0th week of term in which the course is taught. Late requests, and requests sent by email, will not be considered. All requests must be approved by the relevant Computer Science departmental committee and can only be submitted using this form.