Control structures in programming languages: from goto to algebraic effects

Xavier Leroy

This book is a journey through the design space and history of programming languages from the perspective of control structures: the language mechanisms that enable programs to control their execution flows. Starting with the “goto” jumps of early programming languages and the emergence of structured programming in the 1960s, the book explores advanced control structures for imperative languages such as generators and coroutines, then develops alternate views of control in functional languages, first as continuations and their control operators, then as algebraic effects and effect handlers. Blending history, code examples, and theory, the book offers an original, comparative perspective on programming languages, as well as an extensive introduction to algebraic effects and other contemporary research topics in P.L.

Publication history

To be published by Cambridge University Press.

Book preview

This is an HTML preview of the book, generated with Hevea. License: CC-BY-NC-ND 4.0.

Part I: Control structures for imperative languages

Part II: Control operators for functional languages

Part III: From exceptions to algebraic effects and handlers

Part IV: Reasoning about control and effects

Code samples

The code samples shown in the book are available as a ZIP archive and are also shown in the pages below. License: MIT.