skip to primary navigationskip to content
 

Course pages 2022–23

Concepts in Programming Languages

Handouts

  • Lecture slides (as PDF, 1-up)
  • Lecture slides (as PDF, 4-up)
  • 2021/22 Revision Guide.
  • Errata/Lacunae [last updated 23 May 2023]:
    • Unfortunately the audio channel failed for lecture 2 (and the video is black and white).
      The material presented is fortunately similar to that which was presented last year. See Lisp and Algol and the first 12m:35s of Object Oriented [Concepts].
      Differences: this year's notes (and silent video) add more material on "Behavioural Subtyping" and remove the material on "Is ML an object-oriented language" (present in last year's video).
      The slides above are definitive, not last year's videos.
    • Slide 60 uses the term "tag field" without explaining it. It should say that "k" (of enumeration type "kind") appearing in the Pascal code on slide 59 is an example of a tag field.
      C union types are often referred to as "untagged unions", and any programmer-desired discriminator (or tag) needs to coded separately, e.g. as a separate member of any struct containing the union.
    • On slide 95, the "α ≈ β" is just syntax for a type constraint; such constraints are emitted at each node of an expression's AST.
      Slide 97 shows how, for a simple example, type constraints are emitted (top), collected (middle) and solved (bottom).
      Logically ≈ means "demand these are equal types"; this can be achieved by Prolog-style unification.
    • Sadly, the audio channel failed again for lecture 8. The material is also covered in last year's recordings.
      Dependent types [start 12:23 into the video] and Rust and Koka.
      The additional examples of Rust code lectured (in the soundless lecture) are available below under "several examples to illustrate memory-allocation control in Rust".

Some additional background and code examples

Core Exercises

The exercises have not changed in this version of the web page, but have been re-ordered.

  • One-per-topic discussion questions
  • 2021/22 Revision Guide.
  • Past exam questions. 2015–2022 are most relevant. Note there is an error in y2021p7q1(b); ask your supervisor after attempting it.
    Note also that exam questions for 2020, 2021 and 2022 were "open book"; thus they may appear harder than questions intended for "in-person" exams.
  • Questions on variance:
    • Why does this C++ code give exactly one type error? Why is this error message necessary for type safety?
    • Why does this Java code raise an exception? What happens when the various commented-out code is uncommented?

There are also two sets of supervision exercises below; doing them all is perhaps overkeen, but supervisors should select from them.

Supervision exercises by Andrej Ivašković

Supervision question sets courtesy of Andrew Rice

(Note that topics VII, X and XI have been added/re-written since these questions were written.)


Slides by topic and pointers to further reading material

  1. Introduction and motivation.
    Supplementary reading material:
  2. The first procedural language: FORTRAN (1954-58).
    Supplementary reading material:
  3. The first declarative language: LISP (1958-62).
    Supplementary reading material:
  4. Block-structured procedural languages: Algol (1958-68) and Pascal (1970).
    Supplementary reading material:
  5. Object-oriented languages – Concepts and origins: SIMULA (1964-67) and Smalltalk (1971-80).
    Programming language: Squeak.
    Supplementary reading material:
  6. Types in programming languages: ML (1973-1978).
    Supplementary reading material:
  7. Scripting Languages and Dynamic Typing.
  8. Data abstraction and modularity: SML Modules (1984-97).
    Supplementary reading material:
  9. Languages for concurrency and parallelism
    • Functional-style programming meets object-orientation
      Programming language: Scala.
      Supplementary reading material:
    • Miscellaneous concepts.
      Supplementary reading material:

    Books

    Further reading material (due to Marcelo Fiore); not needed for examination purposes