By now students will have seen and used a variety of programming languages. In this module they will also understand the principles behind their design along with techniques for transforming human-friendly programs written in high-level programming languages such as C, Java, or Haskell, into machine-friendly sets of instructions, written for example in assembly. This module introduces some of the central concepts and techniques used to design and study programming languages, from syntactic and semantic specification to compilation. Students will see how to design a language by first defining its syntax (e.g., grammar rules) and semantics (e.g., operational semantics). They will further learn how types can be used to guarantee that programs are “safe”, thereby preventing certain catastrophic errors. We will see that types have other uses. They can for example be used as abstraction mechanisms that allow hiding implementation details. Finally, the module will describe the structure of a typical compiler, including front end phases that implement the syntactic and semantic specification of a language, and the code generation and optimization backend phases, as well as the key techniques used in those phases.
Learning Outcomes
By the end of the module students should be able to:
Understand the principles behind parsing
Understand operational semantics and abstract machines
Understand the principles of code optimisation and generation
Understand the use of types to guarantee safety properties
Understand and prove compiler correctness
Demonstrate the capacity to independently study, understand, and critically evaluate advanced materials or research articles in the subject areas covered by this module.
Apply typing algorithms to check or infer types
Use compilation techniques to transform source code into target code
Understand the principles behind those compilation techniques