Beyond SICP -- Design and Implementation of a Notional Machine for Scheme
Kyriel Abad, Martin Henz
TL;DR
The paper addresses the difficulty of teaching Scheme's dynamic behavior by proposing the CSE machine, a notional machine that extends SICP's environment model to a full small-step evaluator for SICP Scheme. It formalizes the machine as a triple state $(C,S,E)$ with five instructions and closures, and then extends it to support call/cc via reified continuations. The authors implement the CSE machine in the Source Academy web platform, enabling visualization and interaction to reinforce learning, and demonstrate its applicability to modern variants and future extensions. The work provides a coherent, scalable mental model for CS1 that can be adapted to broader languages with visualization support.
Abstract
Computer science education has been at the heart of Scheme from the beginning. The language was designed in the 1970s concurrently with the MIT course 6.001 and the textbook "Structure and Interpretation of Computer Programs" (SICP). To explain the scope of variables at run time in the presence of higher-order procedures, SICP introduces a mental model called the environment model, along with a pictorial representation of environments and data structures. Recently, the concept of notional machines has emerged in computer science education: a predictive set of abstractions that define the structure and behavior of a computational device. Proponents of notional machines argue that learners benefit when complex dynamic concepts such as the computational structure of Scheme are accompanied with concise notional machines. In this paper, we start with a sublanguage of Scheme sufficient for all programs in SICP that we call SICP Scheme. We extend the environment model to a full notional machine for SICP Scheme that is simple enough to serve as the central mental model in a CS1 course and demonstrate the machine with computer-generated visualizations. Moving beyond SICP Scheme, we show how the notional machine can be further extended to explain Scheme's call/cc and thus make this powerful concept accessible to beginners through a coherent mental model. The presented notional machine serves as the core of a web-based implementation of Scheme that is under development at our university.
