-
Notifications
You must be signed in to change notification settings - Fork 108
CSE Machine
Theoth Normie edited this page Apr 5, 2024
·
15 revisions
The CSE machine is an evaluation model for Source languages, based on Chapters 3 and 4 of Structure and Interpretation of Computer Programs (SICP). It is used to evaluate programs in Source §4 Explicit-Control, as well as display the CSE Machine visualization for programs in Source §3 and Source §4.
The code that implements the CSE machine can be found in src/cse-machine/interpreter.js.
The CSE machine consists of three key components:
-
Control: A stack that stores syntax tree nodes to be evaluated and instructions to be executed.
-
Stash: A stack of values that is manipulated through instructions.
-
Environment: A structure containing all bindings in the program, as well as enforcing variable scope.