Structure and Interpretation of Computer Programs (SICP) introduces central ideas of computation by establishing mental models for programming. This edition adapts the foundational concepts, originally presented using Scheme, to the JavaScript programming language, making its material accessible through a modern, widely-used language. The first three chapters present programming concepts common to all high-level languages. Chapters four and five focus on language processors, with chapter four introducing program parsing and chapter five detailing an evaluator and compiler that utilize a subtle stack discipline. This discipline supports return statements in statement-oriented languages without sacrificing tail recursion.
The book's origin lies in an entry-level computer science course at MIT. SICP is known for its influence on computer science curricula globally. This adaptation ensures that the JavaScript programs run on any ECMAScript 2020 compliant implementation, with accompanying resources available on the MIT Press website.
Key concepts
- Mental Models for Computation — The book establishes abstract representations to understand how computation works.
- Program Parsing — Introduces the process of analyzing a string of symbols to determine its grammatical structure according to a given formal grammar.
- Evaluator — A program that computes the value of an expression.
- Compiler — A program that translates code from one programming language to another, often from a high-level language to a lower-level one.
- Stack Discipline — A specific arrangement of data and operations, used here to manage function calls and returns.
- Tail Recursion — A recursive call that is the last operation in a function, allowing for optimization by avoiding stack growth.