Cover of Structure and Interpretation of Computer Programs, second edition by Harold Abelson, Gerald Jay Sussman - Business and Economics Book

From "Structure and Interpretation of Computer Programs, second edition"

Author: Harold Abelson, Gerald Jay Sussman
Publisher: MIT Press
Year: 1996
Category: Computers

🎧 Free Preview Complete

You've listened to your free 10-minute preview.
Sign up free to continue listening to the full summary.

🎧 Listen to Summary

Free 10-min Preview
0:00
Speed:
10:00 free remaining
Chapter 4: Metalinguistic Abstraction
Key Insight 3 from this chapter

Extending Language Functionality Through Evaluator Modification and Derived Expressions

Key Insight

A key advantage of designing an evaluator as an accessible program is the ability to implement alternative evaluation rules by directly modifying the evaluator itself. This provides fine-grained control over language semantics. For instance, in chapter 3, stream programs were cumbersome due to Scheme's applicative-order evaluation; by modifying the evaluator, section 4.2 provides for a more elegant normal-order evaluation, giving enhanced control over how computational models embody the notion of time.

Evaluator modification enables the implementation of ambitious linguistic changes and entirely new programming paradigms. Section 4.3 describes a language for nondeterministic computing where expressions can have multiple values, allowing processes to generate all possible values and search for those satisfying specific constraints, conceptually modeling 'time branching into possible futures.' Similarly, section 4.4 details the implementation of a logic-programming language that expresses knowledge through relations, differing drastically from conventional computation. Remarkably, even these diverse evaluators share the essential structure of the Lisp evaluator.

Language expressiveness can also be enhanced and the evaluator simplified through derived expressions. These are special forms that are defined in terms of existing expressions and transformed before evaluation. A prime example is `cond` expressions, which are syntactically transformed into a nested series of `if` expressions. This strategy reduces the number of special forms that require direct handling by the core `eval` procedure, thereby simplifying the evaluator's implementation while still supporting a richer, more convenient syntax for the language user. `let` expressions are also examples of derived expressions.

📚 Continue Your Learning Journey — No Payment Required

Access the complete Structure and Interpretation of Computer Programs, second edition summary with audio narration, key takeaways, and actionable insights from Harold Abelson, Gerald Jay Sussman.