Programming Language Technology

DAT151 (Chalmers) / DIT231 (GU)
Winter Term 2016 (LP2)

Google group: (please provide your full name and date of birth when requesting membership!)

Fire / Chalmers studieportal / GU course description / GU course page stub / Course page 2015

News and changes

Exam review on 12 September 13:30 in office EDIT 6117. (Solution)

Reexam on 24 August 14:00 in M.

Lab resubmission via Fire until 6 April.

Reexam on 11 April in SB (Sven Hultins gata 6).

Exam review on 25 April 10am room EDIT 8103 (the conference room behind the EDIT lunch room on the top floor).

Exam 1 solution.

Restored old exams for exam preparation.

Collection of errata for the PLT book.

lab4 has been released.

The lecture had a mistake in the call-by-name evaluation rule for application. The correct rule is in the PLT book on page 132.

Tentative Schedule

All lectures are in HC2, starting at 13:15.

Material: plt = course book, dragon = Dragon book. Slides follow closely the plt book.

Date Time Title Material
Tue 01/11 13-15 Compilation Phases / BNFC slides, plt 1, dragon 1
Thu 03/11 13-15 Grammars / Hands-on with Lab 1 slides, plt 2, dragon 2.8.2,4.1-4.3
Tue 08/11 13-15 Theory of lexing lab1 PM
Thu 10/11 13-15 Theory of lexing and parsing slides, plt 3, dragon 3,4
Mon 14/11 23 Lab 1 deadline
Tue 15/11 13-15 Interpreting slides, plt 5
Thu 17/11 13-15 Type checking slides, plt 4, dragon 5,6
Tue 22/11 13-14 Hands-on with Lab 2 (Haskell) lab2 PM
Tue 22/11 14-15 Hands-on with Lab 2 (Java)
Thu 24/11 13-15 Code generation slides, plt 6, dragon 6,7
Mon 28/11 23 Lab 2 deadline
Tue 29/11 13-14 Hands-on with Lab 3 (Haskell) lab3 PM
Tue 29/11 14-15 Hands-on with Lab 3 (Java)
Thu 01/12 13-15 Functional programming languages slides, plt 7, dragon 6.5,7.3
Tue 06/12 13-15 Type inference and polymorphism plt 7.7-9
Thu 08/12 13-15 Hands-on with Lab 4 lab4 PM
Mon 12/12 23 Lab 3 deadline
Tue 13/12 13-15 Dependent types (Agda) Agda demo start finish
Thu 15/12 13-15 Preparing for the exam Training Exam
Mon 09/01 23 Lab 4 deadline
Wed 11/01 8.30-12.30 Exam (M) Solution
Mon 16/01 23 Final lab deadline all lab returns
Thu 30/03 Lab resubmission intent deadline
Thu 06/04 Late final lab deadline
Tue 11/04 8.30-12.30 Exam (SB) Solution
Fri 24/08 14-18 Exam (M) Solution
Tue 12/09 13.30 Exam review

The official course schema is in Time Edit.


The aim of the course is to give understanding of how programming languages are designed, documented, and implemented. The course covers the basic techniques and tools needed to write interpreters, and gives a summary introduction to compilation as well. Those who have passed the course should be able to

  1. define the lexical structure of programming languages by using regular expressions, explain the functioning of finite automata, and implement lexical analysers by using standard tools;
  2. define the syntax of programming languages by using context-free grammars, explain the principles of LL and LR parsing, and implement parsers by using standard tools;
  3. define and implement abstract syntax;
  4. master the technique of syntax-directed translation and its efficient implementation in their chosen programming language;
  5. formulate typing rules and implement type checkers;
  6. formulate operational semantic rules and implement interpreters;
  7. write simple code generators;
  8. be familiar with the basic implementation issues of both imperative and functional languages;
  9. design and implement special-purpose programming languages;
  10. master the principles of polymorphic type checking by unification;
  11. implement an interpreter for a functional language.


Andreas Abel, course teacher and examiner.

Daniel Hausknecht, Andreas Lööw, Daniel Schoepe, assistants.

Google Group

If you have any general questions regarding the course, the labs or the exercises, please ask them in our Google group. This will reach all teachers and fellow students. If you are not yet member of the group, you have to

You will have to give your real name and your person number (or date of birth) when you register, otherwise your membership is not approved. This is necessary to identify you as a participant of the course.

Laboration times and supervision

Lab supervision take place in ED3354.

Day Time Supervisors
Tue 15:15-17:00 AL DH
Thu 15:15-17:00 DH DS
Fri 13:15-15:00 DS AL

The lab rooms and supervision are available from Tue 1 November till Fri 16 December 2016.

Attendance in these classes is optional. Normally, each student should attend at most one supervised laboration time each week. Since attendance is not compulsory, there may be room for more times. But, if there is lack of room, those who attend their first supervision of the week have priority to get a place and supervisor help.


There will be four laborations, written individually or in pairs.

The labs are quite substantial, so please set aside at least 20 full working hours before the deadline.

Reporting is done via Fire. Before reporting, you must run your program through a test suite.

We guarantee two gradings per lab: one for the version submitted before the ordinary deadline for that lab, the other for a resubmission before the final deadline. If your first submission is after the lab deadline, only one grading is guaranteed.

If you did not pass the labs by the end of the course you will have another opportunity in connection with the re-exam in April. The deadline will be Thursday, 6 April 2017. If you intend to re-submit labs then, please contact the course responsible via email on 30 March at the latest. If you need help you should also contact the course responsible, not the teaching assistants. Note however that you can only expect limited support. If you need a substantial amount of help, it is probably better to wait until next time the course is given.


The main book will be one that developed from earlier editions of this course:

Aarne Ranta
Implementing Programming Languages. An Introduction to Compilers and Interpreters, College Publications, London, 2012. Web page (with extra material and links to selling sites):

If you are really interested in the topic, for instance, if you want to continue with the Compiler Construction course, you should also consider the Dragon book,

Aho, Lam, Sethi & Ullman
Compilers Principles, Techniques & Tools Second edition, Pearson/Addison Wesley 2007.

Both books are available at web bookshops. The main book will also be sold at Cremona.


Written exam, usual grading scales.

Exam dates: 11 Jan 2017 fm J, 11 Apr 2017 fm SB, 24 Aug 2017 em J.

The exam has the same structure as these old exams (download as archive).

Further, here are some exercises and solutions to prepare for the exam.


BNF Converter 2.8.1,

If using the Java backend, you will need the Cup and JLex libraries. You can download pre-compiled versions here. Make sure they are placed in your classpath, for example by extracting to ~/javatools/ adding the following to .bashrc:

    export CLASSPATH=.:~/javatools/:~/javatools/Cup/:${CLASSPATH}

Student representatives

Student representatives for DAT151 Programming language technology.

Program Name
MPSOF nabah Omar Abu NABAH
TKDAT hermanh Herman HÖRNSTEIN
MPALG yagublu Lamiya YAGUBLU