Canvas / GitLab / Schedule / Slack / Chalmers studieportal / GU ad (sv) / GU kursplan / GU course description / Course page 2022
Lectures are Tuesdays and Thursdays, starting at 13:15, both on campus and in Zoom. Tuesday lectures are in HC2, Thursday lectures in SB-H6, with exceptions Thu 2nd Nov and 23rd Nov in SB-H5.
Material: plt = course book, dragon = Dragon book. Slides follow closely the plt book.
|Tue 31/10||13-15||PL Design, Compilation Phases||slides, plt 1, dragon 1, live coding start, result|
|Thu 02/11||13-15 SB-H5||Grammars / BNFC / Hands-on with Lab 1||slides, plt 2, dragon 2.8.2,4.1-4.3, git|
|Tue 07/11||13-15||Formal languages and parsing||slides, plt 3, dragon 3,4, shift-reduce parsing LR-table|
|Thu 09/11||13-15||Theory of lexing||slides, plt 3, dragon 3,4|
|Mon 13/11||23||Lab 1 deadline|
|Tue 14/11||13-15||Type checking||slides, plt 4, dragon 5,6, script prime.c|
|Thu 16/11||13-15||Interpreting||slides, plt 5, script|
|Tue 21/11||no lecture||Hands-on with Lab 2: video from 2021||Media Gallery|
|Thu 23/11||13-15 SB-H5||Code generation (lecture: Jonas Höfer)||slides, plt 6, dragon 6,7, notes, prime.c, prime.j|
|Mon 27/11||23||Lab 2 deadline|
|Tue 28/11||no lecture||Hands-on with Lab 3: videos from 2022||Media Gallery|
|Thu 30/11||video from 2022||Functional programming languages||slides, plt 7, dragon 6.5,7.3, script|
|Tue 05/12||13-15||Type inference and polymorphism||plt 7.7-9, script|
|Thu 07/12||13-14||Hands-on with Lab 4 (Haskell)|
|Thu 07/12||14-15||Hands-on with Lab 4 (Java)|
|Tue 12/12||13-15||Type inference. A taste of dependent types||Agda demo Verified compilation|
|Wed 13/12||23||Lab 3 deadline|
|Thu 14/12||13-15||Preparing for the exam|
|Mon 08/01||23||Lab 4 deadline|
|Fri 26/01||23||Final lab deadline||all lab returns|
|Thu 04/04||8.30-12.30||First reexam|
|Thu 29/08||14-18||Second reexam|
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
Andreas Abel, responsible course teacher and examiner.
haohu student chalmers se(insert @ and .)
Lab supervision is available in room ED3354 and online on Tue, Thu and Fri.
|Tue||15:15-17:00||Zoom, ED3354||Andreas, Andras, Jonas|
|Wed||15:15-17:00||Zoom only||Eric, Felix|
|Thu||15:15-17:00||Zoom, ED3354||Felix, Hao, Jonas||
|Fri||13:15-15:00||Zoom, ED3354||Andras, Eric, Hao|
The lab rooms and supervision are
available from Tue 31 Oct till Fri 15 Dec 2023,
except for Fri 03 Nov which is a half-day.
Starting 08 Nov we offer Zoom supervision on Wednesdays 15:15-17:00, please use the slack channel
#queue to queue for Zoom supervision during that time.
We use Slack to organize the lab supervision. Please join our Slack workspace.
The TAs will be present in lab rooms during lab supervision slots, available for help both in-person and virtually. To ask for help, just send a ticket request through the
#queue Slack channel.
https://chalmers.zoom.us/j/6435657890/pwd=OXlBcGxMZjkzNGsyplpYZENYWlVodi09), so that the TA knows where to find you.
You are expected to find a lab partner, with whom you will do the labs.
If you have difficulties finding a partner, please use Slack channel
You have to pass the labs to pass the course. However, the course grade is determined solely by the exam.
The labs are quite substantial, so please set aside at least 30 full working hours (4 full working days) before the deadline. It is recommended to start at least 10 days before the deadline.
Labs are to be solved in groups of two. (Individual solutions are accepted per exception, please contact the course responsible.) Groups are formed on Canvas and then recreated automatically on Chalmers GitLab. After the first lab has been submitted, the groups are fixed. (Should you nevertheless need to urgently change to group, please contact the course responsible.)
The labs will be published in your Gitlab group and a solution repository will be created for you there.
Submission of your solution is by creating a
submission tag in the repository.
Please read the detailed lab instructions at:
Keep your lab solutions confidential! If you post problems and discussions around the labs on Canvas etc., make sure you do not give away the solution.
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 does not build or does not pass the testsuite, you will just get fails testsuite as grading.
As part of the grading, you may be asked to explain your solution in person to a course teacher. Be prepared to get a call for such an explanation meeting. In particular, make sure you understand all parts of the solution (good documentation helps!).
The written exam determines the course grade, the usual grading scales apply: Chalmers: 5, 4, 3, U; Gothenburg University: MVG, VG, G, U.
Exam dates: 11 Jan 2024 am J, 04 Apr 2024 am J, 29 Aug 2024 pm J.
The exam tests the understanding of the course contents from a more high-level view, e.g., the underlying theoretical concepts. The exam has the same structure as these old exams (download as archive).
Further, here are some old exercises and solutions to prepare for the exam.
The main book will be one that developed from earlier editions of this course:
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,
Both books are available at web bookshops. The main book will also be sold at Cremona.
A good (yet slightly dated) introduction to monads in Haskell, useful for implementing interpreters, type checkers, and compilers, is this article:
It also contains an introduction to parser combinators.
If you are solving the labs on your own Windows machine, you might have to obtain some
command-line developer tools stemming from the Unix world, like
(These are by default available on Linux and can be installed from Xcode on macOS.)
Windows from version 10 offers installation of a Linux distro via the
Windows Subsystem for Linux
Another popular option is MSYS2 which is also bundeled with
We use the BNF Converter (Homepage | Hackage | Stackage | GitHub) in version 2.8.4 or above. Download and installation instructions at https://bnfc.digitalgrammars.com/.
When using the Java backend, you will need either ANTLR or the CUP libraries and either JFLex or the JLex libraries. CUP has seen incompatible changes in its interface; thus, the version you need may depend on your BNFC version.
Download the JAVA archives for
CUP v11b runtime, and
Make sure they are placed in your classpath, for example (Linux / macOS)
by storing these jars in
$HOME/java-lib/ and adding the following line (or a suitable variant) to
(could also be
.bash_profile or similar):
Student representatives for DAT151 Programming language technology.