Compiler Construction

Computer programs are usually written in a so-called high-level programming language, such as C, Java, or Haskell. Execution of such programs requires either a compiler or an interpreter for the language.

In its most general form, a compiler is a piece of software that takes as input a program written in a certain (usually: high-level) language and produces as output a translation of that program into another (more low-level) language. Examples include: compilers that translate C programs into machine code for an IA-32 processor; compilers that translate Java programs into bytecode instructions for the Java Virtual Machine; but also: software for translating Latex documents into HTML. In contrast, interpretation is concerned with the direct execution of (the actions described by) a source program.

In this course, we study aspects of compilers and interpreters. We do so by considering some of the language constructs that typically appear in modern imperative and functional programming languages, and by looking at what kind of analyses these constructs require in order to be compiled or interpreted. We delve into formalisms, tools, and programming techniques that are particulary well-suited for crafting compilers and interpreters, but that are often also useful and relevant for other, more general forms of software construction.

The course consists largely of the following four advanced topics in compiler construction (for each of the first three, there is a practical assignment):

In addition, we shall have a number of advanced level presentations that may incite you to do a master thesis in that area.

The practical assignments are all to be performed in Haskell, and we expect students to be familiar with that language (for example, by doing our bachelor course on Functional Programming). If you don’t know Haskell you are at very significant disadvantage compared to your fellow students. Familiarity with aspects of parsing and lexing (for example, by doing our bachelor course on Talen en Compilers) may be useful during the practicals.