Laboratory exercises (Programming Languages)
Solutions for tutors and demonstrators are on a separate page.
There are three laboratory exercises for the course:
- An exercise asking you to write a functional program for flattening nested lists, transform it into iterative form using an explicit stack, and then rewrite it using assignable variables and a loop. All this will be done in the Fun language that we will be studying in the course.
- An exercise where you will write a monadic interpreter for a language that combines call-by-name with assignable variables. This combination leads to a language with some strange features that are interesting to exploit.
- An exercise in exploring the semantics of a loop-with-exit construct that extends one present in Oberon.
I suggest that you attempt all three exercises, omitting the first one if it does not seem helpful.
Instructions for the labs are contained in a laboratory manual.
The supporting materials are accessible in a Mercurial repository that can be cloned with the command
hg clone http://spivey.oriel.ox.ac.uk/hg/proglan
For safety's sake, I've also provided the materials here, packed into a single archive.