Previous Up Next

Preface

This book is based on a course titled “Structures de contrôle” that I taught at Collège de France in Paris in January–March 2024. One of the goals of the open lectures at Collège de France is to teach “research in the making”, that is, to make recent research results accessible to a fairly broad audience. For my 2024 course, the recent result in question was the discovery of effect handlers as a new control operator for functional programming languages by Bauer, Pretnar and others in the 2010s, and their integration into the OCaml language in 2022.

Research results do not emerge in a vacuum, of course. Often, therefore, the best way to understand them is to trace the history of the ideas that led to these results. In the case of effect handlers, this history is especially long and rich. It encompasses not only the theory of algebraic effects from the 2000s and the theory and practice of monads from the 1990s, but also the emergence of call/cc and other control operators in functional languages in the 1970s and 1980s, and the study of continuations as a semantic tool and as a programming device beginning in the late 1960s.

I could have organized my course along these lines. Instead, I chose to place it in the broader context of control structures in programming languages, which are the constructs that languages provide to programmers for expressing the sequencing and interleaving of computations. This has been a key aspect in the evolution of programming languages and practices, from Fortran (1957) and Algol (1960) to the “goto considered harmful” controversy of the late 1960s and the flurry of advanced control structures (exceptions, coroutines, generators, threads, control operators, etc.) of the 1970s and 1980s.

Thus, my course, which was originally intended to be an advanced introduction to the practice and the theory of effect handlers, evolved to include a historical and comparative perspective on programming languages viewed through the lens of their control structures.

In writing this book, I wanted to explore this approach further and share it with a broader English-speaking audience. The comparative perspective is still far from complete, focusing on imperative and functional languages but only mentioning object orientation in passing and omitting logic programming entirely. However, this book goes beyond describing programming language features and illustrating them with program examples: it also covers topics in programming language theory, such as operational semantics, type systems and program logics, that shed additional light on control structures. I hope readers will find this perspective on programming languages as instructive and fruitful as I did when writing this book.

Acknowledgments

Many people helped me prepare this book. The separation logic for the call1cc operator described in section 15.4 emerged during discussions with Paulo de Vilhena. Jean-Christophe Filliâtre proofread the entire first draft book. His keen eye, experience in writing textbooks, and insightful feedback greatly improved the text. The anonymous reviewers of the book proposal provided valuable, albeit often adversarial, feedback. Alve Björk, François Pottier, KC Sivaramakrishnan, and Paulo de Vilhena proofread parts of the book and pointed out numerous errors. Special thanks go to David Tranah, editorial director at Cambridge University Press, who not only welcomed my book project but also performed the copyediting himself, guiding me through the subtleties of the English language and PDF accessibility rules. Thank you all for your help in publishing this book!



Paris, May 2026
Xavier Leroy


Previous Up Next