Logo

Control structures

Xavier Leroy

Collège de France, chair of software sciences, 2023-2024

This is an English translation of Xavier Leroy's 2023-2024 lectures at Collège de France, "Structures de contrôle".

Abstract

A computer program describes not only the basic computations to be performed on input data, but also in which order and under which conditions to perform these computations. To express this sequencing of computations, programming language provide mechanisms called control structures. Since the "goto" jumps of early programming languages, many control structures have been deployed: conditionals, loops, procedures and functions, exceptions, iterators, coroutines, continuations… After an overview of these classic control structures and their historical context, the course develops a more modern approach of control viewed as an object that programs can manipulate, enabling programmers to define their own control structures. Started in the last century by early work on continuations and the associated control operators, this approach was recently renewed through the theory of algebraic effects and its applications to user-defined effects and effect handlers in languages such as OCaml 5.

Lectures

  1. Introduction and course outline.
  2. The birth of control structures: from "goto" to structured programming.
  3. Non-local control: from subroutines to functions and coroutines.
  4. Declarative programming: getting rid of control?
  5. Continuations and control operators: building blocks for control structures.
  6. The practice of effects: from exceptions to effect handlers.
  7. The theory of effects: from monads to algebraic effects.
  8. Static typing of effects.
  9. Program logics for control and effects.

Seminar talks

Some talks were given in English, others in French. Video recordings and slides can be found on the seminar course pages.


Xavier.Leroy@college-de-france.fr