SlideShare ist ein Scribd-Unternehmen logo
Structure And Interpretation Of Computer
Programs 2e Javascript Edition 2nd Edition
Harold Abelson download
https://ebookbell.com/product/structure-and-interpretation-of-
computer-programs-2e-javascript-edition-2nd-edition-harold-
abelson-49972362
Explore and download more ebooks at ebookbell.com
Here are some recommended products that we believe you will be
interested in. You can click the link to download.
Structure And Interpretation Of Computer Programs Second Edition 2nd
Edition Hal Abelson And Gerald Jay Sussman
https://ebookbell.com/product/structure-and-interpretation-of-
computer-programs-second-edition-2nd-edition-hal-abelson-and-gerald-
jay-sussman-5849384
Structure And Interpretation Of Computer Programs Javascript
Adaptation 2nd Harold Abelson And Gerald Jay Sussman With Julie
Sussman Adapted By Martin Henz And Tobias Wrigstad
https://ebookbell.com/product/structure-and-interpretation-of-
computer-programs-javascript-adaptation-2nd-harold-abelson-and-gerald-
jay-sussman-with-julie-sussman-adapted-by-martin-henz-and-tobias-
wrigstad-23009056
Structure And Interpretation Of Computer Programs Javascript Edition
Harold Abelson Gerald Sussman Martin Henz Tobias Wrigstad
https://ebookbell.com/product/structure-and-interpretation-of-
computer-programs-javascript-edition-harold-abelson-gerald-sussman-
martin-henz-tobias-wrigstad-62620506
6001 Structure And Interpretation Of Computer Programs Copyright
https://ebookbell.com/product/6001-structure-and-interpretation-of-
computer-programs-copyright-2463106
Structure And Interpretation Of Signals And Systems 1st Edward A Lee
https://ebookbell.com/product/structure-and-interpretation-of-signals-
and-systems-1st-edward-a-lee-4573552
Structure And Interpretation Of Classical Mechanics 2nd Edition Gerald
Jay Sussman
https://ebookbell.com/product/structure-and-interpretation-of-
classical-mechanics-2nd-edition-gerald-jay-sussman-7354242
Structure And Interpretation Of Classical Mechanics Gerald Jay Sussman
https://ebookbell.com/product/structure-and-interpretation-of-
classical-mechanics-gerald-jay-sussman-931284
Structure And Interpretation Of Signals And Systems Edward A Lee
https://ebookbell.com/product/structure-and-interpretation-of-signals-
and-systems-edward-a-lee-1305958
Structure And Interpretation Of Classical Mechanics G Sussman
https://ebookbell.com/product/structure-and-interpretation-of-
classical-mechanics-g-sussman-4094762
Structure And Interpretation Of Computer Programs 2e Javascript Edition 2nd Edition Harold Abelson
Structure and Interpretation of Computer Programs
JavaScript Edition
Structure And Interpretation Of Computer Programs 2e Javascript Edition 2nd Edition Harold Abelson
Structure and Interpretation of Computer Programs
JavaScript Edition
Harold Abelson and Gerald Jay Sussman
adapted to JavaScript by Martin Henz and Tobias Wrigstad
with Julie Sussman
The MIT Press
Cambridge, Massachusetts
London, England
© 2022 Massachusetts Institute of Technology
This book is published by The MIT Press under a Creative Commons
Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA). To view a
copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/.
The text of this book is derived from the book Structure and Interpretation of Computer
Programs, Second Edition, 1996, (SICP) and is subject to a Creative Commons
Attribution-ShareAlike 4.0 International License (CC BY-SA). A comparison edition available
at http://sicp.sourceacademy.org indicates the changes that were made to the text. The figures
are derived from figures created by Andres Raba in 2015 and are also subject to CC BY-SA.
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
The JavaScript programs in this book are derived from the Scheme programs in SICP and are
subject to the GNU General Public License v3.0. To view a copy of this license, visit
https://www.gnu.org/licenses/gpl-3.0.html.
The original image of MIT founder William Barton Rogers in section 2.2.4 is courtesy MIT
Museum.
The cover image is adapted from Le Moyen Age et la Renaissance, Paris, 1848–1851.
This book was set in Times by the authors using the L
A
TEX typesetting system and ancillary
scripts (see https://github.com/source-academy/sicp), and was printed and bound in the United
States of America.
Library of Congress Cataloging-in-Publication Data
Names: Abelson, Harold, author. | Sussman, Gerald Jay, author. | Henz, Martin, adapter. |
Wrigstad, Tobias, adapter. | Sussman, Julie, other.
Title: Structure and interpretation of computer programs / Harold Abelson and Gerald Jay
Sussman; adapted to JavaScript by Martin Henz and Tobias Wrigstad; with Julie Sussman.
Description: Javascript edition. | Cambridge : The MIT Press, [2022] | Series: MIT electrical
engineering and computer science series | Includes bibliographical references and index.
Identifiers: LCCN 2021047249 | ISBN 9780262543231 (paperback)
Subjects: LCSH: Computer programming. | JavaScript (Computer program language)
Classification: LCC QA76.6 .A255 2022 | DDC 005.13–dc23
LC record available at https://lccn.loc.gov/2021047249
10 9 8 7 6 5 4 3 2 1
This book is dedicated, in respect and admiration,
to the spirit that lives in the computer.
Structure And Interpretation Of Computer Programs 2e Javascript Edition 2nd Edition Harold Abelson
“I think it’s extraordinarily important that we in computer science keep fun
in computing. When it started out, it was an awful lot of fun. Of course,
the paying customers got shafted every now and then, and after a while we
began to take their complaints seriously. We began to feel as though we
really were responsible for the successful, error-free, perfect use of these
machines. I don’t think we are. I think we’re responsible for stretching them,
setting them off in new directions, and keeping fun in the house. Fun comes
in many ways. Fun comes in making a discovery, proving a theorem, writing
a program, breaking a code. Whatever form or sense it comes in I hope the
field of computer science never loses its sense of fun. Above all, I hope we
don’t become missionaries. What you know about computing other people
will learn. Don’t feel as though the key to successful computing is only in
your hands. What’s in your hands, I think and hope, is intelligence: the ability
to see the machine as more than when you were first led up to it, that you
can make it more.”
—Alan J. Perlis (April 1, 1922–February 7, 1990)
Structure And Interpretation Of Computer Programs 2e Javascript Edition 2nd Edition Harold Abelson
Contents
Foreword xiii
Foreword to Structure and Interpretation of Computer Programs, 1984 xvii
Preface xxi
Prefaces to Structure and Interpretation of Computer Programs, 1996 & 1984 xxiii
Acknowledgments xxvii
1 Building Abstractions with Functions 1
1.1 The Elements of Programming 3
1.1.1 Expressions 3
1.1.2 Naming and the Environment 5
1.1.3 Evaluating Operator Combinations 6
1.1.4 Compound Functions 8
1.1.5 The Substitution Model for Function Application 11
1.1.6 Conditional Expressions and Predicates 13
1.1.7 Example: Square Roots by Newton’s Method 18
1.1.8 Functions as Black-Box Abstractions 21
1.2 Functions and the Processes They Generate 26
1.2.1 Linear Recursion and Iteration 27
1.2.2 Tree Recursion 32
1.2.3 Orders of Growth 36
1.2.4 Exponentiation 38
1.2.5 Greatest Common Divisors 41
1.2.6 Example: Testing for Primality 43
1.3 Formulating Abstractions with Higher-Order Functions 48
1.3.1 Functions as Arguments 49
1.3.2 Constructing Functions using Lambda Expressions 53
1.3.3 Functions as General Methods 58
1.3.4 Functions as Returned Values 63
2 Building Abstractions with Data 69
2.1 Introduction to Data Abstraction 72
2.1.1 Example: Arithmetic Operations for Rational Numbers 72
2.1.2 Abstraction Barriers 76
2.1.3 What Is Meant by Data? 78
2.1.4 Extended Exercise: Interval Arithmetic 81
x Contents
2.2 Hierarchical Data and the Closure Property 84
2.2.1 Representing Sequences 85
2.2.2 Hierarchical Structures 93
2.2.3 Sequences as Conventional Interfaces 98
2.2.4 Example: A Picture Language 110
2.3 Symbolic Data 124
2.3.1 Strings 124
2.3.2 Example: Symbolic Differentiation 126
2.3.3 Example: Representing Sets 131
2.3.4 Example: Huffman Encoding Trees 140
2.4 Multiple Representations for Abstract Data 148
2.4.1 Representations for Complex Numbers 150
2.4.2 Tagged data 153
2.4.3 Data-Directed Programming and Additivity 157
2.5 Systems with Generic Operations 164
2.5.1 Generic Arithmetic Operations 165
2.5.2 Combining Data of Different Types 170
2.5.3 Example: Symbolic Algebra 177
3 Modularity, Objects, and State 191
3.1 Assignment and Local State 192
3.1.1 Local State Variables 192
3.1.2 The Benefits of Introducing Assignment 199
3.1.3 The Costs of Introducing Assignment 202
3.2 The Environment Model of Evaluation 208
3.2.1 The Rules for Evaluation 209
3.2.2 Applying Simple Functions 212
3.2.3 Frames as the Repository of Local State 215
3.2.4 Internal Declarations 220
3.3 Modeling with Mutable Data 224
3.3.1 Mutable List Structure 224
3.3.2 Representing Queues 233
3.3.3 Representing Tables 237
3.3.4 A Simulator for Digital Circuits 243
3.3.5 Propagation of Constraints 254
3.4 Concurrency: Time Is of the Essence 265
3.4.1 The Nature of Time in Concurrent Systems 266
3.4.2 Mechanisms for Controlling Concurrency 270
3.5 Streams 282
3.5.1 Streams Are Delayed Lists 283
3.5.2 Infinite Streams 290
3.5.3 Exploiting the Stream Paradigm 297
3.5.4 Streams and Delayed Evaluation 307
3.5.5 Modularity of Functional Programs and Modularity of Objects 313
Contents xi
4 Metalinguistic Abstraction 319
4.1 The Metacircular Evaluator 321
4.1.1 The Core of the Evaluator 323
4.1.2 Representing Components 330
4.1.3 Evaluator Data Structures 341
4.1.4 Running the Evaluator as a Program 346
4.1.5 Data as Programs 350
4.1.6 Internal Declarations 353
4.1.7 Separating Syntactic Analysis from Execution 357
4.2 Lazy Evaluation 362
4.2.1 Normal Order and Applicative Order 363
4.2.2 An Interpreter with Lazy Evaluation 364
4.2.3 Streams as Lazy Lists 372
4.3 Nondeterministic Computing 375
4.3.1 Search and amb 376
4.3.2 Examples of Nondeterministic Programs 380
4.3.3 Implementing the amb Evaluator 388
4.4 Logic Programming 400
4.4.1 Deductive Information Retrieval 403
4.4.2 How the Query System Works 413
4.4.3 Is Logic Programming Mathematical Logic? 421
4.4.4 Implementing the Query System 426
5 Computing with Register Machines 451
5.1 Designing Register Machines 452
5.1.1 A Language for Describing Register Machines 454
5.1.2 Abstraction in Machine Design 458
5.1.3 Subroutines 459
5.1.4 Using a Stack to Implement Recursion 464
5.1.5 Instruction Summary 470
5.2 A Register-Machine Simulator 470
5.2.1 The Machine Model 472
5.2.2 The Assembler 476
5.2.3 Instructions and Their Execution Functions 479
5.2.4 Monitoring Machine Performance 486
5.3 Storage Allocation and Garbage Collection 489
5.3.1 Memory as Vectors 490
5.3.2 Maintaining the Illusion of Infinite Memory 495
5.4 The Explicit-Control Evaluator 501
5.4.1 The Dispatcher and Basic Evaluation 502
5.4.2 Evaluating Function Applications 506
5.4.3 Blocks, Assignments, and Declarations 514
5.4.4 Running the Evaluator 515
xii Contents
5.5 Compilation 521
5.5.1 Structure of the Compiler 524
5.5.2 Compiling Components 529
5.5.3 Compiling Applications and Return Statements 537
5.5.4 Combining Instruction Sequences 545
5.5.5 An Example of Compiled Code 548
5.5.6 Lexical Addressing 556
5.5.7 Interfacing Compiled Code to the Evaluator 559
References 567
Index 573
List of Exercises 609
Foreword
I had the pleasure of meeting the amazing Alan Perlis and talking with him a few
times, when I was still a student. He and I had in common a deep love and respect
for two very different programming languages: Lisp and APL. Following in his
footsteps is a daunting task, even though he blazed an excellent trail. Still, I would
like to reexamine one comment he made in the original foreword to this book (and,
please, I suggest that you read his foreword, which immediately follows this one,
before you finish this one). Is it really true that it is better to have 100 functions
operate on one data structure than to have 10 functions operate on 10 data structures?
To answer that question carefully, we first need to ask whether that one data struc-
ture is “universal”: can it conveniently fulfill the roles of those 10 more specialized
data structures?
For that matter, we can also ask: do we really need 100 functions? Is there a
single universal function that can fulfill the roles of all those other functions?
The surprising answer to that last question is “yes”; it is only slightly tricky to
construct a function that accepts (1) a data structure that serves as a description
of some other function, and (2) a list of arguments, and behaves exactly as that
other function would when applied to the given arguments. And it is only slightly
tricky to design a data structure capable of describing any computation whatsoever.
One such data structure (the tagged-list representation of expressions and statements,
paired with environments that associate names with values) and one such universal
function (apply) are described in Chapter 4 of this book. So maybe we need only
one function and one data structure.
That is true in theory. In practice, we find it convenient to draw distinctions that
help us, as human beings constructing descriptions of computations, to organize the
structure of our code so that we can better understand them. I believe that Perlis was
making a remark not about computational capability, but about human abilities and
human limitations.
One thing the human mind seems to do well is to name things; we have powerful
associative memories. Given a name, we can quickly recall some associated thing to
mind. This is why we typically find it easier to work with the lambda calculus than
the combinatory calculus; it is much easier for most people to interpret the Lisp
expression (lambda (x) (lambda (y) (+ x y))) or the JavaScript expression
x => y => x + y than the combinatory expression
((S ((S (K S)) ((S ((S (K S)) ((S (K K)) (K +)))) ((S (K K)) I)))) (K I))
even though there is a direct structural correspondence, easily expressed in five lines
of Lisp code.
So while in principle we could get by with just one universal function, we pre-
fer to modularize our code, to give names to the various pieces, and to mention
the names of function descriptions rather than constantly feeding the descriptions
themselves to the universal function.
xiv Foreword
In my 1998 talk “Growing a Language,” I commented that a good programmer
“does not just write programs. A good programmer builds a working vocabulary.” As
we design and define more and more parts of our programs, we give names to those
parts, and the result is that we have a richer language in which to write the rest.
But we also find it natural to draw distinctions among data structures, and to give
them names.
It may be that nested lists are a universal data structure (and it is worth noting
that many modern and widely used data structures, such as HTML and XML and
JSON, are also parenthetically nested representations, only slightly more elaborate
than Lisp’s bare parentheses). There are also many functions, such as finding the
length of a list or applying a function to every element of a list and getting back a
list of the results, that are useful in a wide variety of situations. And yet, when I am
thinking about a specific computation, I often say to myself, “This list of two things
I expect to be a personal name and a surname, but that list of two things I expect
to be the real and imaginary parts of a complex number, and that other list of two
things I will regard as the numerator and denominator of a fraction.” In other words,
I draw distinctions—and it may be useful to represent those distinctions explicitly in
the data structure, in part to prevent mistakes such as accidentally treating a complex
number as a fraction. (Again, this is a comment about human abilities and human
limitations.)
Since the first edition of this book was written, almost four decades ago, a lot
more ways of organizing data have become relatively standard, in particular the
“object-oriented” approach, and many languages, including JavaScript, support spe-
cialized data structures such as objects and strings and heaps and maps with a variety
of built-in mechanisms and libraries. But in doing so, many languages abandoned
support for more general, universal notions. Java, for example, originally did not sup-
port first-class functions, and has incorporated them only relatively recently, greatly
increasing its expressive power.
APL, likewise, originally did not support first-class functions, and moreover its
original single data structure—arrays of any number of dimensions—was not so
conveniently useful as a universal data structure because arrays could not contain
other arrays as elements. More recent versions of APL do support anonymous
function values and nested arrays, and these have made APL dramatically more
expressive. (The original design of APL did have two very good things going for it:
a comprehensive set of functions applicable to that one data structure, and moreover
an extremely well chosen set of names for those functions. I’m not talking about
the funny symbols and Greek letters, but the spoken words that APL programmers
use when mentioning them, words like shape, reshape, compress, expand, and
laminate; these are names not for the symbols, but for the functions they repre-
sent. Ken Iverson had a real knack for choosing short, memorable, vivid names for
functions on arrays.)
While JavaScript, like Java, was originally designed with objects and methods
in mind, it also incorporated first-class functions from the beginning, and it is not
difficult to use its objects to define a universal data structure. As a result, JavaScript
Foreword xv
is not as distant from Lisp as you would think, and as this edition of Structure and
Interpretation of Computer Programs demonstrates, it is a good alternate framework
for presenting the key ideas. SICP was never about a programming language; it
presents powerful, general ideas for program organization that ought to be useful in
any language.
What do Lisp and JavaScript have in common? The ability to abstract a compu-
tation (code plus some associated data) for later execution as a function; the ability
to embed references to such functions within data structures; the ability to invoke
functions on arguments; the ability to draw a distinction (conditional execution); a
convenient universal data structure; completely automatic storage management for
that data (which seems like a no-brainer, given everything else, until you realize
that many widely used programming languages don’t have it); a large set of useful
functions for operating on that universal data structure; and standard strategies for
using the universal data structure to represent more specialized data structures.
So maybe the truth is somewhere in between the extremes that Perlis so elo-
quently posited. Maybe the sweet spot is something more like 40 functions general
enough to operate usefully on a universal data structure such as lists, but also 10
sets of 6 functions each that are relevant when we take one of 10 specialized views
of that universal data structure. This is manageable if we give good names to these
functions and specialized views.
As you read this book, please pay attention not only to the programming lan-
guage constructs and how they are used, but also to the names given to functions
and variables and data structures. They are not all as short and vivid as the names
Iverson chose for his APL functions, but they have been chosen in a deliberate and
systematic way to enhance your understanding of the overall program structure.
Primitives, means of combination, functional abstraction, naming, and conven-
tions for using a universal data structure in specialized ways by drawing distinctions:
these are the fundamental building blocks of a good programming language. From
there, imagination and good engineering judgment based on experience can do the
rest.
—Guy L. Steele Jr., Lexington, Massachusetts, 2021
Structure And Interpretation Of Computer Programs 2e Javascript Edition 2nd Edition Harold Abelson
Foreword to Structure and Interpretation of
Computer Programs, 1984
Educators, generals, dieticians, psychologists, and parents program. Armies, stu-
dents, and some societies are programmed. An assault on large problems employs
a succession of programs, most of which spring into existence en route. These pro-
grams are rife with issues that appear to be particular to the problem at hand. To
appreciate programming as an intellectual activity in its own right you must turn
to computer programming; you must read and write computer programs—many of
them. It doesn’t matter much what the programs are about or what applications they
serve. What does matter is how well they perform and how smoothly they fit with
other programs in the creation of still greater programs. The programmer must seek
both perfection of part and adequacy of collection. In this book the use of “program”
is focused on the creation, execution, and study of programs written in a dialect of
Lisp for execution on a digital computer. Using Lisp we restrict or limit not what we
may program, but only the notation for our program descriptions.
Our traffic with the subject matter of this book involves us with three foci of
phenomena: the human mind, collections of computer programs, and the computer.
Every computer program is a model, hatched in the mind, of a real or mental process.
These processes, arising from human experience and thought, are huge in number,
intricate in detail, and at any time only partially understood. They are modeled to
our permanent satisfaction rarely by our computer programs. Thus even though our
programs are carefully handcrafted discrete collections of symbols, mosaics of in-
terlocking functions, they continually evolve: we change them as our perception
of the model deepens, enlarges, generalizes until the model ultimately attains a
metastable place within still another model with which we struggle. The source of
the exhilaration associated with computer programming is the continual unfolding
within the mind and on the computer of mechanisms expressed as programs and
the explosion of perception they generate. If art interprets our dreams, the computer
executes them in the guise of programs!
For all its power, the computer is a harsh taskmaster. Its programs must be cor-
rect, and what we wish to say must be said accurately in every detail. As in every
other symbolic activity, we become convinced of program truth through argument.
Lisp itself can be assigned a semantics (another model, by the way), and if a pro-
gram’s function can be specified, say, in the predicate calculus, the proof methods
of logic can be used to make an acceptable correctness argument. Unfortunately, as
programs get large and complicated, as they almost always do, the adequacy, con-
sistency, and correctness of the specifications themselves become open to doubt, so
that complete formal arguments of correctness seldom accompany large programs.
Since large programs grow from small ones, it is crucial that we develop an arsenal
of standard program structures of whose correctness we have become sure—we call
them idioms—and learn to combine them into larger structures using organizational
techniques of proven value. These techniques are treated at length in this book, and
understanding them is essential to participation in the Promethean enterprise called
xviii Foreword to SICP, 1984
programming. More than anything else, the uncovering and mastery of powerful or-
ganizational techniques accelerates our ability to create large, significant programs.
Conversely, since writing large programs is very taxing, we are stimulated to invent
new methods of reducing the mass of function and detail to be fitted into large
programs.
Unlike programs, computers must obey the laws of physics. If they wish to per-
form rapidly—a few nanoseconds per state change—they must transmit electrons
only small distances (at most 11
2 feet). The heat generated by the huge number of
devices so concentrated in space has to be removed. An exquisite engineering art has
been developed balancing between multiplicity of function and density of devices.
In any event, hardware always operates at a level more primitive than that at which
we care to program. The processes that transform our Lisp programs to “machine”
programs are themselves abstract models which we program. Their study and cre-
ation give a great deal of insight into the organizational programs associated with
programming arbitrary models. Of course the computer itself can be so modeled.
Think of it: the behavior of the smallest physical switching element is modeled by
quantum mechanics described by differential equations whose detailed behavior is
captured by numerical approximations represented in computer programs executing
on computers composed of ...!
It is not merely a matter of tactical convenience to separately identify the three
foci. Even though, as they say, it’s all in the head, this logical separation induces
an acceleration of symbolic traffic between these foci whose richness, vitality, and
potential is exceeded in human experience only by the evolution of life itself. At
best, relationships between the foci are metastable. The computers are never large
enough or fast enough. Each breakthrough in hardware technology leads to more
massive programming enterprises, new organizational principles, and an enrichment
of abstract models. Every reader should ask himself periodically “Toward what
end, toward what end?”—but do not ask it too often lest you pass up the fun of
programming for the constipation of bittersweet philosophy.
Among the programs we write, some (but never enough) perform a precise math-
ematical function such as sorting or finding the maximum of a sequence of numbers,
determining primality, or finding the square root. We call such programs algorithms,
and a great deal is known of their optimal behavior, particularly with respect to the
two important parameters of execution time and data storage requirements. A pro-
grammer should acquire good algorithms and idioms. Even though some programs
resist precise specifications, it is the responsibility of the programmer to estimate,
and always to attempt to improve, their performance.
Lisp is a survivor, having been in use for about a quarter of a century. Among the
active programming languages only Fortran has had a longer life. Both languages
have supported the programming needs of important areas of application, Fortran
for scientific and engineering computation and Lisp for artificial intelligence. These
two areas continue to be important, and their programmers are so devoted to these
two languages that Lisp and Fortran may well continue in active use for at least
another quarter-century.
Lisp changes. The Scheme dialect used in this text has evolved from the original
Lisp and differs from the latter in several important ways, including static scoping
for variable binding and permitting functions to yield functions as values. In its
Foreword to SICP, 1984 xix
semantic structure Scheme is as closely akin to Algol 60 as to early Lisps. Algol
60, never to be an active language again, lives on in the genes of Scheme and
Pascal. It would be difficult to find two languages that are the communicating coin of
two more different cultures than those gathered around these two languages. Pascal
is for building pyramids—imposing, breathtaking, static structures built by armies
pushing heavy blocks into place. Lisp is for building organisms—imposing, breath-
taking, dynamic structures built by squads fitting fluctuating myriads of simpler
organisms into place. The organizing principles used are the same in both cases,
except for one extraordinarily important difference: The discretionary exportable
functionality entrusted to the individual Lisp programmer is more than an order
of magnitude greater than that to be found within Pascal enterprises. Lisp programs
inflate libraries with functions whose utility transcends the application that produced
them. The list, Lisp’s native data structure, is largely responsible for such growth of
utility. The simple structure and natural applicability of lists are reflected in func-
tions that are amazingly nonidiosyncratic. In Pascal the plethora of declarable data
structures induces a specialization within functions that inhibits and penalizes casual
cooperation. It is better to have 100 functions operate on one data structure than to
have 10 functions operate on 10 data structures. As a result the pyramid must stand
unchanged for a millennium; the organism must evolve or perish.
To illustrate this difference, compare the treatment of material and exercises
within this book with that in any first-course text using Pascal. Do not labor under
the illusion that this is a text digestible at MIT only, peculiar to the breed found there.
It is precisely what a serious book on programming Lisp must be, no matter who the
student is or where it is used.
Note that this is a text about programming, unlike most Lisp books, which are
used as a preparation for work in artificial intelligence. After all, the critical program-
ming concerns of software engineering and artificial intelligence tend to coalesce
as the systems under investigation become larger. This explains why there is such
growing interest in Lisp outside of artificial intelligence.
As one would expect from its goals, artificial intelligence research generates
many significant programming problems. In other programming cultures this spate
of problems spawns new languages. Indeed, in any very large programming task a
useful organizing principle is to control and isolate traffic within the task modules
via the invention of language. These languages tend to become less primitive as
one approaches the boundaries of the system where we humans interact most often.
As a result, such systems contain complex language-processing functions replicated
many times. Lisp has such a simple syntax and semantics that parsing can be treated
as an elementary task. Thus parsing technology plays almost no role in Lisp pro-
grams, and the construction of language processors is rarely an impediment to the
rate of growth and change of large Lisp systems. Finally, it is this very simplicity
of syntax and semantics that is responsible for the burden and freedom borne by
all Lisp programmers. No Lisp program of any size beyond a few lines can be
written without being saturated with discretionary functions. Invent and fit; have
fits and reinvent! We toast the Lisp programmer who pens his thoughts within nests
of parentheses.
—Alan J. Perlis, New Haven, Connecticut
Structure And Interpretation Of Computer Programs 2e Javascript Edition 2nd Edition Harold Abelson
Preface
The book Structure and Interpretation of Computer Programs (SICP) introduces
the reader to central ideas of computation by establishing a series of mental models
for computation. Chapters 1–3 cover programming concepts that are common to
all modern high-level programming languages. The original first two editions of
SICP use the programming language Scheme in their program examples, whose
minimalist, expression-oriented syntax allows the book to focus on the underlying
ideas rather than the design of the chosen language. Chapters 4 and 5 use Scheme
to formulate language processors for Scheme, deepening the readers’ understanding
of the mental models and exploring language extensions and alternatives.
Since its publication in 1984 and its second edition in 1996, SICP has been
adopted as a textbook by universities and colleges around the world, including the
National University of Singapore (NUS), which introduced the SICP-based introduc-
tory course CS1101S in 1997. In the mid-1990s, the languages Python, JavaScript,
and Ruby emerged, which share central design elements with Scheme, but which em-
ploy a more complex, statement-oriented syntax that uses familiar algebraic (infix)
notation. Their rise in popularity led instructors to adapt their SICP-based courses,
typically by translating the example programs to their language of choice, by adding
material specific to that language, and by omitting the material of chapters 4 and 5.
Adapting SICP to JavaScript
The work on adapting the second edition of SICP to JavaScript (SICP JS) started at
NUS in 2008, and CS1101S switched to JavaScript in 2012. The language standard
ECMAScript 2015 introduced lambda expressions, tail recursion, and block-scoped
variables and constants, which enabled the adaptation to become quite close to the
original. We made substantial changes to SICP only when we felt they were forced
by differences between JavaScript and Scheme. The book covers just a small frac-
tion of JavaScript, so a reader would be ill-advised to use it to learn the language.
For example, the notion of a JavaScript object—considered one of its fundamental
ingredients by any measure—is not even mentioned!
It was straightforward to translate the programs of chapters 1–3 to JavaScript
by adding libraries that mirror Scheme primitives—including support for list struc-
ture—and adapting the text accordingly. However, the switch to JavaScript forced
us to make subtle changes in the interpreters and compiler of chapters 4 and 5 in
order to handle return statements. Scheme’s expression-oriented syntax doesn’t have
return statements, which are a prominent feature of statement-oriented languages.
By using JavaScript, chapters 1–3 introduce the reader to the syntactic style of
most mainstream languages today. However, that same syntactic style gave rise to
significant changes in chapter 4, because the direct representation of programs as
data structures could no longer be taken for granted. This provided us with an op-
portunity to introduce the reader to the notion of program parsing in section 4.1, an
important component of programming-language processors. In section 4.4, the rigid
syntactic structure of JavaScript complicated the implementation of the presented
xxii Preface
logic programming system and exposed the limitations of JavaScript as a tool for
programming language design.
Resources for using SICP JS
The MIT Press web page for SICP JS links to support for users of this book. This
provides all programs from the book and extensive instructor resources, including a
large collection of additional exercises and recommendations on selecting a subset
of SICP JS that can be covered in a typical college semester. The JavaScript pro-
grams in the book run in the recommended strict mode in any JavaScript interpreter
that complies with the ECMAScript 2020 specification of JavaScript (ECMA 2020).
The MIT Press web page includes the JavaScript package sicp, which provides all
JavaScript functions that are considered “primitive” in the book.
To the reader
We sincerely hope that if this book is your first encounter with programming you will
use your newly gained understanding of the structure and interpretation of computer
programs to learn more programming languages, including Scheme and the full
JavaScript language. If you have learned JavaScript prior to picking up SICP JS, you
might gain new insights into the fundamental concepts that underlie the language
and discover how much can be achieved with so little. If you come to SICP JS with
a knowledge of the original SICP, you might enjoy seeing familiar ideas presented
in a new format—and might appreciate the online comparison edition, available at
the book’s web page, where SICP JS and SICP can be viewed side by side.
—Martin Henz and Tobias Wrigstad
Prefaces to Structure and Interpretation of
Computer Programs, 1996 & 1984
Preface to the Second Edition of SICP, 1996
Is it possible that software is not like anything else, that it is meant to be
discarded: that the whole point is to always see it as a soap bubble?
—Alan J. Perlis
The material in this book has been the basis of MIT’s entry-level computer science
subject since 1980. We had been teaching this material for four years when the first
edition was published, and twelve more years have elapsed until the appearance
of this second edition. We are pleased that our work has been widely adopted and
incorporated into other texts. We have seen our students take the ideas and programs
in this book and build them in as the core of new computer systems and languages. In
literal realization of an ancient Talmudic pun, our students have become our builders.
We are lucky to have such capable students and such accomplished builders.
In preparing this edition, we have incorporated hundreds of clarifications sug-
gested by our own teaching experience and the comments of colleagues at MIT
and elsewhere. We have redesigned most of the major programming systems in the
book, including the generic-arithmetic system, the interpreters, the register-machine
simulator, and the compiler; and we have rewritten all the program examples to
ensure that any Scheme implementation conforming to the IEEE Scheme standard
(IEEE 1990) will be able to run the code.
This edition emphasizes several new themes. The most important of these is
the central role played by different approaches to dealing with time in computa-
tional models: objects with state, concurrent programming, functional programming,
lazy evaluation, and nondeterministic programming. We have included new sections
on concurrency and nondeterminism, and we have tried to integrate this theme
throughout the book.
The first edition of the book closely followed the syllabus of our MIT one-
semester subject. With all the new material in the second edition, it will not be
possible to cover everything in a single semester, so the instructor will have to pick
and choose. In our own teaching, we sometimes skip the section on logic program-
ming (section 4.4), we have students use the register-machine simulator but we do
not cover its implementation (section 5.2), and we give only a cursory overview of
the compiler (section 5.5). Even so, this is still an intense course. Some instructors
may wish to cover only the first three or four chapters, leaving the other material for
subsequent courses.
The World Wide Web site of MIT Press provides support for users of this book.
This includes programs from the book, sample programming assignments, supple-
mentary materials, and downloadable implementations of the Scheme dialect of
Lisp.
—Harold Abelson and Gerald Jay Sussman
xxiv Prefaces to SICP, 1996 & 1984
Preface to the First Edition of SICP, 1984
A computer is like a violin. You can imagine a novice trying first a
phonograph and then a violin. The latter, he says, sounds terrible. That is the
argument we have heard from our humanists and most of our computer
scientists. Computer programs are good, they say, for particular purposes, but
they aren’t flexible. Neither is a violin, or a typewriter, until you learn how to
use it.
—Marvin Minsky, “Why Programming Is a Good Medium for Expressing
Poorly-Understood and Sloppily-Formulated Ideas”
“The Structure and Interpretation of Computer Programs” is the entry-level subject
in computer science at the Massachusetts Institute of Technology. It is required of
all students at MIT who major in electrical engineering or in computer science, as
one-fourth of the “common core curriculum,” which also includes two subjects on
circuits and linear systems and a subject on the design of digital systems. We have
been involved in the development of this subject since 1978, and we have taught
this material in its present form since the fall of 1980 to between 600 and 700
students each year. Most of these students have had little or no prior formal training
in computation, although many have played with computers a bit and a few have
had extensive programming or hardware-design experience.
Our design of this introductory computer-science subject reflects two major con-
cerns. First, we want to establish the idea that a computer language is not just a
way of getting a computer to perform operations but rather that it is a novel formal
medium for expressing ideas about methodology. Thus, programs must be written
for people to read, and only incidentally for machines to execute. Second, we believe
that the essential material to be addressed by a subject at this level is not the syntax of
particular programming-language constructs, nor clever algorithms for computing
particular functions efficiently, nor even the mathematical analysis of algorithms
and the foundations of computing, but rather the techniques used to control the
intellectual complexity of large software systems.
Our goal is that students who complete this subject should have a good feel
for the elements of style and the aesthetics of programming. They should have
command of the major techniques for controlling complexity in a large system. They
should be capable of reading a 50-page-long program, if it is written in an exemplary
style. They should know what not to read, and what they need not understand at any
moment. They should feel secure about modifying a program, retaining the spirit
and style of the original author.
These skills are by no means unique to computer programming. The techniques
we teach and draw upon are common to all of engineering design. We control
complexity by building abstractions that hide details when appropriate. We control
complexity by establishing conventional interfaces that enable us to construct sys-
tems by combining standard, well-understood pieces in a “mix and match” way. We
control complexity by establishing new languages for describing a design, each of
which emphasizes particular aspects of the design and deemphasizes others.
Underlying our approach to this subject is our conviction that “computer sci-
ence” is not a science and that its significance has little to do with computers. The
Prefaces to SICP, 1996 & 1984 xxv
computer revolution is a revolution in the way we think and in the way we express
what we think. The essence of this change is the emergence of what might best be
called procedural epistemology—the study of the structure of knowledge from an
imperative point of view, as opposed to the more declarative point of view taken
by classical mathematical subjects. Mathematics provides a framework for dealing
precisely with notions of “what is.” Computation provides a framework for dealing
precisely with notions of “how to.”
In teaching our material we use a dialect of the programming language Lisp.
We never formally teach the language, because we don’t have to. We just use it,
and students pick it up in a few days. This is one great advantage of Lisp-like
languages: They have very few ways of forming compound expressions, and almost
no syntactic structure. All of the formal properties can be covered in an hour, like the
rules of chess. After a short time we forget about syntactic details of the language
(because there are none) and get on with the real issues—figuring out what we want
to compute, how we will decompose problems into manageable parts, and how we
will work on the parts. Another advantage of Lisp is that it supports (but does not
enforce) more of the large-scale strategies for modular decomposition of programs
than any other language we know. We can make procedural and data abstractions, we
can use higher-order functions to capture common patterns of usage, we can model
local state using assignment and data mutation, we can link parts of a program with
streams and delayed evaluation, and we can easily implement embedded languages.
All of this is embedded in an interactive environment with excellent support for
incremental program design, construction, testing, and debugging. We thank all the
generations of Lisp wizards, starting with John McCarthy, who have fashioned a
fine tool of unprecedented power and elegance.
Scheme, the dialect of Lisp that we use, is an attempt to bring together the
power and elegance of Lisp and Algol. From Lisp we take the metalinguistic power
that derives from the simple syntax, the uniform representation of programs as data
objects, and the garbage-collected heap-allocated data. From Algol we take lexical
scoping and block structure, which are gifts from the pioneers of programming-
language design who were on the Algol committee. We wish to cite John Reynolds
and Peter Landin for their insights into the relationship of Church’s lambda calculus
to the structure of programming languages. We also recognize our debt to the math-
ematicians who scouted out this territory decades before computers appeared on the
scene. These pioneers include Alonzo Church, Barkley Rosser, Stephen Kleene, and
Haskell Curry.
—Harold Abelson and Gerald Jay Sussman
Structure And Interpretation Of Computer Programs 2e Javascript Edition 2nd Edition Harold Abelson
Acknowledgments
The JavaScript adaptation of Structure and Interpretation of Computer Programs
(SICP JS) was developed at the National University of Singapore (NUS) for the
course CS1101S. The course was co-taught for six years and counting by Low Kok
Lim, whose sound pedagogical judgment was crucial for the success of the course
and this project. The CS1101S teaching team has included many NUS colleagues
and more than 300 undergraduate student assistants. Their continuous feedback over
the past nine years allowed us to resolve countless JavaScript-specific issues and
remove unnecessary complications and yet retain the essential features of both SICP
and JavaScript.
SICP JS is a software project in addition to a book project. We obtained the L
A
TEX
book sources from the original authors in 2008. An early SICP JS tool chain was
developed by Liu Hang and refined by Feng Piaopiao. Chan Ger Hean developed
the first tools for the print edition, based on which Jolyn Tan developed the tools
for the first e-book edition and He Xinyue and Wang Qian repurposed these tools
for the current comparison edition. Samuel Fang designed and developed the online
edition of SICP JS.
The online edition of SICP JS and CS1101S rely heavily on a software sys-
tem called Source Academy, and the JavaScript sublanguages it supports are called
Source. Many dozens of students have contributed to the Source Academy during
the preparation of SICP JS, and the system lists them prominently as “Contribu-
tors.” Since 2020, the students of the NUS course CS4215, Programming Language
Implementation, contributed several programming language implementations that
are used in SICP JS: The concurrent version of Source used in section 3.4 was
developed by Zhengqun Koo and Jonathan Chan; the lazy implementation used in
section 4.2 was developed by Jellouli Ahmed, Ian Kendall Duncan, Cruz Jomari
Evangelista, and Alden Tan; the nondeterministic implementation used in section
4.3 was developed by Arsalan Cheema and Anubhav; and Daryl Tan helped integrate
these implementations into the Academy.
We are grateful to STINT, The Swedish Foundation for International Coopera-
tion in Research and Higher Education, whose sabbatical program connected Martin
and Tobias and allowed Tobias to work as a co-teacher of CS1101S and join the
SICP JS project.
We would like to acknowledge the courageous work of the committee of ECMA-
Script 2015, led by Allen Wirfs-Brock. SICP JS relies heavily on constant and let
declarations and lambda expressions, all of which were added to JavaScript with
ECMAScript 2015. Those additions allowed us to stay close to the original in the
presentation of the most important ideas of SICP. Guy Lewis Steele Jr., who led the
first ECMAScript standardization, provided detailed and useful feedback on some
exercises of chapter 4.
—Martin Henz and Tobias Wrigstad
xxviii Acknowledgements
Acknowledgments from the Second Edition of SICP, 1996
We would like to thank the many people who have helped us develop this book and
this curriculum.
Our subject is a clear intellectual descendant of “6.231,” a wonderful subject on
programming linguistics and the lambda calculus taught at MIT in the late 1960s by
Jack Wozencraft and Arthur Evans, Jr.
We owe a great debt to Robert Fano, who reorganized MIT’s introductory cur-
riculum in electrical engineering and computer science to emphasize the principles
of engineering design. He led us in starting out on this enterprise and wrote the first
set of subject notes from which this book evolved.
Much of the style and aesthetics of programming that we try to teach were de-
veloped in conjunction with Guy Lewis Steele Jr., who collaborated with Gerald
Jay Sussman in the initial development of the Scheme language. In addition, David
Turner, Peter Henderson, Dan Friedman, David Wise, and Will Clinger have taught
us many of the techniques of the functional programming community that appear in
this book.
Joel Moses taught us about structuring large systems. His experience with the
Macsyma system for symbolic computation provided the insight that one should
avoid complexities of control and concentrate on organizing the data to reflect the
real structure of the world being modeled.
Marvin Minsky and Seymour Papert formed many of our attitudes about pro-
gramming and its place in our intellectual lives. To them we owe the understanding
that computation provides a means of expression for exploring ideas that would oth-
erwise be too complex to deal with precisely. They emphasize that a student’s ability
to write and modify programs provides a powerful medium in which exploring
becomes a natural activity.
We also strongly agree with Alan Perlis that programming is lots of fun and we
had better be careful to support the joy of programming. Part of this joy derives
from observing great masters at work. We are fortunate to have been apprentice
programmers at the feet of Bill Gosper and Richard Greenblatt.
It is difficult to identify all the people who have contributed to the development
of our curriculum. We thank all the lecturers, recitation instructors, and tutors who
have worked with us over the past fifteen years and put in many extra hours on
our subject, especially Bill Siebert, Albert Meyer, Joe Stoy, Randy Davis, Louis
Braida, Eric Grimson, Rod Brooks, Lynn Stein, and Peter Szolovits. We would like
to specially acknowledge the outstanding teaching contributions of Franklyn Turbak,
now at Wellesley; his work in undergraduate instruction set a standard that we can
all aspire to. We are grateful to Jerry Saltzer and Jim Miller for helping us grapple
with the mysteries of concurrency, and to Peter Szolovits and David McAllester for
their contributions to the exposition of nondeterministic evaluation in chapter 4.
Many people have put in significant effort presenting this material at other uni-
versities. Some of the people we have worked closely with are Jacob Katzenelson
at the Technion, Hardy Mayer at the University of California at Irvine, Joe Stoy at
Oxford, Elisha Sacks at Purdue, and Jan Komorowski at the Norwegian University
of Science and Technology. We are exceptionally proud of our colleagues who have
Acknowledgements xxix
received major teaching awards for their adaptations of this subject at other univer-
sities, including Kenneth Yip at Yale, Brian Harvey at the University of California
at Berkeley, and Dan Huttenlocher at Cornell.
Al Moyé arranged for us to teach this material to engineers at Hewlett-Packard,
and for the production of videotapes of these lectures. We would like to thank the tal-
ented instructors—in particular Jim Miller, Bill Siebert, and Mike Eisenberg—who
have designed continuing education courses incorporating these tapes and taught
them at universities and industry all over the world.
Many educators in other countries have put in significant work translating the
first edition. Michel Briand, Pierre Chamard, and André Pic produced a French
edition; Susanne Daniels-Herold produced a German edition; and Fumio Motoyoshi
produced a Japanese edition. We do not know who produced the Chinese edition,
but we consider it an honor to have been selected as the subject of an “unauthorized”
translation.
It is hard to enumerate all the people who have made technical contributions
to the development of the Scheme systems we use for instructional purposes.
In addition to Guy Steele, principal wizards have included Chris Hanson, Joe
Bowbeer, Jim Miller, Guillermo Rozas, and Stephen Adams. Others who have
put in significant time are Richard Stallman, Alan Bawden, Kent Pitman, Jon
Taft, Neil Mayle, John Lamping, Gwyn Osnos, Tracy Larrabee, George Carrette,
Soma Chaudhuri, Bill Chiarchiaro, Steven Kirsch, Leigh Klotz, Wayne Noss, Todd
Cass, Patrick O’Donnell, Kevin Theobald, Daniel Weise, Kenneth Sinclair, Anthony
Courtemanche, Henry M. Wu, Andrew Berlin, and Ruth Shyu.
Beyond the MIT implementation, we would like to thank the many people who
worked on the IEEE Scheme standard, including William Clinger and Jonathan Rees,
who edited the R4RS, and Chris Haynes, David Bartley, Chris Hanson, and Jim
Miller, who prepared the IEEE standard.
Dan Friedman has been a long-time leader of the Scheme community. The
community’s broader work goes beyond issues of language design to encompass
significant educational innovations, such as the high-school curriculum based on
EdScheme by Schemer’s Inc., and the wonderful books by Mike Eisenberg and by
Brian Harvey and Matthew Wright.
We appreciate the work of those who contributed to making this a real book,
especially Terry Ehling, Larry Cohen, and Paul Bethge at the MIT Press. Ella Mazel
found the wonderful cover image. For the second edition we are particularly grate-
ful to Bernard and Ella Mazel for help with the book design, and to David Jones,
TEX wizard extraordinaire. We also are indebted to those readers who made pene-
trating comments on the new draft: Jacob Katzenelson, Hardy Mayer, Jim Miller,
and especially Brian Harvey, who did unto this book as Julie did unto his book
Simply Scheme.
Finally, we would like to acknowledge the support of the organizations that
have encouraged this work over the years, including support from Hewlett-Packard,
made possible by Ira Goldstein and Joel Birnbaum, and support from DARPA, made
possible by Bob Kahn.
—Harold Abelson and Gerald Jay Sussman
Structure And Interpretation Of Computer Programs 2e Javascript Edition 2nd Edition Harold Abelson
Structure and Interpretation of Computer Programs
JavaScript Edition
Structure And Interpretation Of Computer Programs 2e Javascript Edition 2nd Edition Harold Abelson
1 Building Abstractions with Functions
The acts of the mind, wherein it exerts its power over simple ideas, are chiefly
these three: 1. Combining several simple ideas into one compound one, and
thus all complex ideas are made. 2. The second is bringing two ideas, whether
simple or complex, together, and setting them by one another so as to take a
view of them at once, without uniting them into one, by which it gets all its
ideas of relations. 3. The third is separating them from all other ideas that
accompany them in their real existence: this is called abstraction, and thus all
its general ideas are made.
—John Locke, An Essay Concerning Human Understanding (1690)
We are about to study the idea of a computational process. Computational processes
are abstract beings that inhabit computers. As they evolve, processes manipulate
other abstract things called data. The evolution of a process is directed by a pattern
of rules called a program. People create programs to direct processes. In effect, we
conjure the spirits of the computer with our spells.
A computational process is indeed much like a sorcerer’s idea of a spirit. It
cannot be seen or touched. It is not composed of matter at all. However, it is very
real. It can perform intellectual work. It can answer questions. It can affect the
world by disbursing money at a bank or by controlling a robot arm in a factory.
The programs we use to conjure processes are like a sorcerer’s spells. They are
carefully composed from symbolic expressions in arcane and esoteric programming
languages that prescribe the tasks we want our processes to perform.
A computational process, in a correctly working computer, executes programs
precisely and accurately. Thus, like the sorcerer’s apprentice, novice programmers
must learn to understand and to anticipate the consequences of their conjuring. Even
small errors (usually called bugs) in programs can have complex and unanticipated
consequences.
Fortunately, learning to program is considerably less dangerous than learning
sorcery, because the spirits we deal with are conveniently contained in a secure way.
Real-world programming, however, requires care, expertise, and wisdom. A small
bug in a computer-aided design program, for example, can lead to the catastrophic
collapse of an airplane or a dam or the self-destruction of an industrial robot.
Master software engineers have the ability to organize programs so that they can
be reasonably sure that the resulting processes will perform the tasks intended. They
can visualize the behavior of their systems in advance. They know how to structure
programs so that unanticipated problems do not lead to catastrophic consequences,
and when problems do arise, they can debug their programs. Well-designed compu-
tational systems, like well-designed automobiles or nuclear reactors, are designed
in a modular manner, so that the parts can be constructed, replaced, and debugged
separately.
2 Chapter 1 Building Abstractions with Functions
Programming in JavaScript
We need an appropriate language for describing processes, and we will use for this
purpose the programming language JavaScript. Just as our everyday thoughts are
usually expressed in our natural language (such as English, Swedish, or Chinese),
and descriptions of quantitative phenomena are expressed with mathematical no-
tations, our procedural thoughts will be expressed in JavaScript. JavaScript was
developed in 1995 as a programming language for controlling the behavior of World
Wide Web browsers through scripts that are embedded in web pages. The language
was conceived by Brendan Eich, originally under the name Mocha, which was
later renamed to LiveScript, and finally to JavaScript. The name “JavaScript” is a
trademark of Oracle Corporation.
Despite its inception as a language for scripting the web, JavaScript is a general-
purpose programming language. A JavaScript interpreter is a machine that car-
ries out processes described in the JavaScript language. The first JavaScript inter-
preter was implemented by Eich at Netscape Communications Corporation for the
Netscape Navigator web browser. JavaScript inherited its core features from the
Scheme and Self programming languages. Scheme is a dialect of Lisp, and was used
as the programming language for the original version of this book. From Scheme,
JavaScript inherited its most fundamental design principles, such as lexically scoped
first-class functions and dynamic typing.
JavaScript bears only superficial resemblance to the language Java, after which
it was (eventually) named; both Java and JavaScript use the block structure of the
language C. In contrast with Java and C, which usually employ compilation to lower-
level languages, JavaScript programs were initially interpreted by web browsers.
After Netscape Navigator, other web browsers provided interpreters for the language,
including Microsoft’s Internet Explorer, whose JavaScript version is called JScript.
The popularity of JavaScript for controlling web browsers gave rise to a standard-
ization effort, culminating in ECMAScript. The first edition of the ECMAScript
standard was led by Guy Lewis Steele Jr. and completed in June 1997 (ECMA 1997).
The sixth edition, known as ECMAScript 2015, was led by Allen Wirfs-Brock and
adopted by the General Assembly of ECMA in June 2015 (ECMA 2015).
The practice of embedding JavaScript programs in web pages encouraged the
developers of web browsers to implement JavaScript interpreters. As these programs
became more complex, the interpreters became more efficient in executing them,
eventually using sophisticated implementation techniques such as Just-In-Time (JIT)
compilation. The majority of JavaScript programs as of this writing (2021) are em-
bedded in web pages and interpreted by browsers, but JavaScript is increasingly
used as a general-purpose programming language, using systems such as Node.js.
ECMAScript 2015 possesses a set of features that make it an excellent medium
for studying important programming constructs and data structures and for relat-
ing them to the linguistic features that support them. Its lexically scoped first-class
functions and their syntactic support through lambda expressions provide direct and
concise access to functional abstraction, and dynamic typing allows the adaptation
to remain close to the Scheme original throughout the book. Above and beyond
these considerations, programming in JavaScript is great fun.
1.1 The Elements of Programming 3
1.1 The Elements of Programming
A powerful programming language is more than just a means for instructing a
computer to perform tasks. The language also serves as a framework within which
we organize our ideas about processes. Thus, when we describe a language, we
should pay particular attention to the means that the language provides for combin-
ing simple ideas to form more complex ideas. Every powerful language has three
mechanisms for accomplishing this:
• primitive expressions, which represent the simplest entities the language is con-
cerned with,
• means of combination, by which compound elements are built from simpler ones,
and
• means of abstraction, by which compound elements can be named and manipu-
lated as units.
In programming, we deal with two kinds of elements: functions and data. (Later
we will discover that they are really not so distinct.) Informally, data is “stuff” that
we want to manipulate, and functions are descriptions of the rules for manipulating
the data. Thus, any powerful programming language should be able to describe
primitive data and primitive functions and should have methods for combining and
abstracting functions and data.
In this chapter we will deal only with simple numerical data so that we can focus
on the rules for building functions.1 In later chapters we will see that these same
rules allow us to build functions to manipulate compound data as well.
1.1.1 Expressions
One easy way to get started at programming is to examine some typical interac-
tions with an interpreter for the JavaScript language. You type a statement, and the
interpreter responds by displaying the result of its evaluating that statement.
One kind of statement you might type is an expression statement, which consists
of an expression followed by a semicolon. One kind of primitive expression is a
number. (More precisely, the expression that you type consists of the numerals that
represent the number in base 10.) If you present JavaScript with the program
1. The characterization of numbers as “simple data” is a barefaced bluff. In fact, the treatment
of numbers is one of the trickiest and most confusing aspects of any programming language.
Some typical issues involved are these: Some computer systems distinguish integers, such as 2,
from real numbers, such as 2.71. Is the real number 2.00 different from the integer 2? Are the
arithmetic operations used for integers the same as the operations used for real numbers? Does
6 divided by 2 produce 3, or 3.0? How large a number can we represent? How many decimal
places of accuracy can we represent? Is the range of integers the same as the range of real
numbers? Above and beyond these questions, of course, lies a collection of issues concerning
roundoff and truncation errors—the entire science of numerical analysis. Since our focus in this
book is on large-scale program design rather than on numerical techniques, we are going to
ignore these problems. The numerical examples in this chapter will exhibit the usual roundoff
behavior that one observes when using arithmetic operations that preserve a limited number of
decimal places of accuracy in noninteger operations.
4 Chapter 1 Building Abstractions with Functions
486;
the interpreter will respond by printing2
486
Expressions representing numbers may be combined with operators (such as +
or *) to form a compound expression that represents the application of a correspond-
ing primitive function to those numbers. For example,
137 + 349;
486
1000 - 334;
666
5 * 99;
495
10 / 4;
2.5
2.7 + 10;
12.7
Expressions such as these, which contain other expressions as components, are
called combinations. Combinations that are formed by an operator symbol in the
middle, and operand expressions to the left and right of it, are called operator com-
binations. The value of an operator combination is obtained by applying the function
specified by the operator to the arguments that are the values of the operands.
The convention of placing the operator between the operands is known as infix
notation. It follows the mathematical notation that you are most likely familiar with
from school and everyday life. As in mathematics, operator combinations can be
nested, that is, they can have operands that themselves are operator combinations:
(3 * 5) + (10 - 6);
19
As usual, parentheses are used to group operator combinations in order to avoid am-
biguities. JavaScript also follows the usual conventions when parentheses are omit-
ted: multiplication and division bind more strongly than addition and subtraction.
For example,
3 * 5 + 10 / 2;
stands for
(3 * 5) + (10 / 2);
2. Throughout this book, we distinguish between the input typed by the user and any text
printed by the interpreter by showing the latter in slanted characters.
1.1.2 Naming and the Environment 5
We say that * and / have higher precedence than + and -. Sequences of additions
and subtractions are read from left to right, as are sequences of multiplications and
divisions. Thus,
1 - 5 / 2 * 4 + 3;
stands for
(1 - ((5 / 2) * 4)) + 3;
We say that the operators +, -, * and / are left-associative.
There is no limit (in principle) to the depth of such nesting and to the overall
complexity of the expressions that the JavaScript interpreter can evaluate. It is we
humans who might get confused by still relatively simple expressions such as
3 * 2 * (3 - 5 + 4) + 27 / 6 * 10;
which the interpreter would readily evaluate to be 57. We can help ourselves by
writing such an expression in the form
3 * 2 * (3 - 5 + 4)
+
27 / 6 * 10;
to visually separate the major components of the expression.
Even with complex expressions, the interpreter always operates in the same basic
cycle: It reads a statement typed by the user, evaluates the statement, and prints
the result. This mode of operation is often expressed by saying that the interpreter
runs in a read-evaluate-print loop. Observe in particular that it is not necessary to
explicitly instruct the interpreter to print the value of the statement.3
1.1.2 Naming and the Environment
A critical aspect of a programming language is the means it provides for using names
to refer to computational objects, and our first such means are constants. We say that
the name identifies a constant whose value is the object.
In JavaScript, we name constants with constant declarations.
const size = 2;
causes the interpreter to associate the value 2 with the name size.4 Once the name
size has been associated with the number 2, we can refer to the value 2 by name:
3. JavaScript obeys the convention that every statement has a value (see exercise 4.8). This
convention, together with the reputation of JavaScript programmers as not caring about effi-
ciency, leads us to paraphrase a quip on Lisp programmers by Alan Perlis (who was himself
paraphrasing Oscar Wilde): JavaScript programmers know the value of everything but the cost
of nothing.
4. In this book, we do not show the interpreter’s response to evaluating programs that end with
declarations, since this might depend on previous statements. See exercise 4.8 for details.
6 Chapter 1 Building Abstractions with Functions
size;
2
5 * size;
10
Here are further examples of the use of const:
const pi = 3.14159;
const radius = 10;
pi * radius * radius;
314.159
const circumference = 2 * pi * radius;
circumference;
62.8318
Constant declaration is our language’s simplest means of abstraction, for it al-
lows us to use simple names to refer to the results of compound operations, such
as the circumference computed above. In general, computational objects may
have very complex structures, and it would be extremely inconvenient to have to
remember and repeat their details each time we want to use them. Indeed, com-
plex programs are constructed by building, step by step, computational objects
of increasing complexity. The interpreter makes this step-by-step program con-
struction particularly convenient because name-object associations can be created
incrementally in successive interactions. This feature encourages the incremental
development and testing of programs and is largely responsible for the fact that a
JavaScript program usually consists of a large number of relatively simple functions.
It should be clear that the possibility of associating values with names and later
retrieving them means that the interpreter must maintain some sort of memory that
keeps track of the name-object pairs. This memory is called the environment (more
precisely the program environment, since we will see later that a computation may
involve a number of different environments).5
1.1.3 Evaluating Operator Combinations
One of our goals in this chapter is to isolate issues about thinking procedurally.
As a case in point, let us consider that, in evaluating operator combinations, the
interpreter is itself following a procedure.
• To evaluate an operator combination, do the following:
1. Evaluate the operand expressions of the combination.
2. Apply the function that is denoted by the operator to the arguments that are
the values of the operands.
5. Chapter 3 will show that this notion of environment is crucial for understanding how the
interpreter works. Chapter 4 will use environments for implementing interpreters.
1.1.3 Evaluating Operator Combinations 7
15
26
24
2
390
12
3
6
4
+
*
*
+
Figure 1.1 Tree representation, showing the value of each subexpression.
Even this simple rule illustrates some important points about processes in general.
First, observe that the first step dictates that in order to accomplish the evaluation
process for a combination we must first perform the evaluation process on each
operand of the combination. Thus, the evaluation rule is recursive in nature; that is,
it includes, as one of its steps, the need to invoke the rule itself.
Notice how succinctly the idea of recursion can be used to express what, in
the case of a deeply nested combination, would otherwise be viewed as a rather
complicated process. For example, evaluating
(2 + 4 * 6) * (3 + 12);
requires that the evaluation rule be applied to four different combinations. We can
obtain a picture of this process by representing the combination in the form of a tree,
as shown in figure 1.1. Each combination is represented by a node with branches
corresponding to the operator and the operands of the combination stemming from
it. The terminal nodes (that is, nodes with no branches stemming from them) rep-
resent either operators or numbers. Viewing evaluation in terms of the tree, we can
imagine that the values of the operands percolate upward, starting from the terminal
nodes and then combining at higher and higher levels. In general, we shall see that
recursion is a very powerful technique for dealing with hierarchical, treelike objects.
In fact, the “percolate values upward” form of the evaluation rule is an example of a
general kind of process known as tree accumulation.
Next, observe that the repeated application of the first step brings us to the point
where we need to evaluate, not combinations, but primitive expressions such as
numerals or names. We take care of the primitive cases by stipulating that
• the values of numerals are the numbers that they name, and
• the values of names are the objects associated with those names in the environ-
ment.
The key point to notice is the role of the environment in determining the meaning
of the names in expressions. In an interactive language such as JavaScript, it is
meaningless to speak of the value of an expression such as x + 1 without speci-
fying any information about the environment that would provide a meaning for the
name x. As we shall see in chapter 3, the general notion of the environment as
8 Chapter 1 Building Abstractions with Functions
providing a context in which evaluation takes place will play an important role in
our understanding of program execution.
Notice that the evaluation rule given above does not handle declarations. For
instance, evaluating const x = 3; does not apply an equality operator = to two
arguments, one of which is the value of the name x and the other of which is 3,
since the purpose of the declaration is precisely to associate x with a value. (That is,
const x = 3; is not a combination.)
The letters in const are rendered in bold to indicate that it is a keyword in
JavaScript. Keywords carry a particular meaning, and thus cannot be used as names.
A keyword or a combination of keywords in a statement instructs the JavaScript
interpreter to treat the statement in a special way. Each such syntactic form has its
own evaluation rule. The various kinds of statements and expressions (each with its
associated evaluation rule) constitute the syntax of the programming language.
1.1.4 Compound Functions
We have identified in JavaScript some of the elements that must appear in any
powerful programming language:
• Numbers and arithmetic operations are primitive data and functions.
• Nesting of combinations provides a means of combining operations.
• Constant declarations that associate names with values provide a limited means
of abstraction.
Now we will learn about function declarations, a much more powerful abstraction
technique by which a compound operation can be given a name and then referred to
as a unit.
We begin by examining how to express the idea of “squaring.” We might say,
“To square something, take it times itself.” This is expressed in our language as
function square(x) {
return x * x;
}
We can understand this in the following way:
function square( x ) { return x * x ; }
x


x


x


x


x


x


To square something, take it times itself.
We have here a compound function, which has been given the name square. The
function represents the operation of multiplying something by itself. The thing to be
multiplied is given a local name, x, which plays the same role that a pronoun plays
in natural language. Evaluating the declaration creates this compound function and
associates it with the name square.6
6. Observe that there are two different operations being combined here: we are creating the
function, and we are giving it the name square. It is possible, indeed important, to be able
to separate these two notions—to create functions without naming them, and to give names to
functions that have already been created. We will see how to do this in section 1.3.2.
1.1.4 Compound Functions 9
The simplest form of a function declaration is
function name(parameters) { return expression; }
The name is a symbol to be associated with the function definition in the envi-
ronment.7 The parameters are the names used within the body of the function to
refer to the corresponding arguments of the function. The parameters are grouped
within parentheses and separated by commas, as they will be in an application of
the function being declared. In the simplest form, the body of a function declaration
is a single return statement,8 which consists of the keyword return followed by
the return expression that will yield the value of the function application, when the
parameters are replaced by the actual arguments to which the function is applied.
Like constant declarations and expression statements, return statements end with a
semicolon.
Having declared square, we can now use it in a function application expression,
which we turn into a statement using a semicolon:
square(21);
441
Function applications are—after operator combinations—the second kind of combi-
nation of expressions into larger expressions that we encounter. The general form of
a function application is
function-expression(argument-expressions)
where the function-expression of the application specifies the function to be applied
to the comma-separated argument-expressions. To evaluate a function application,
the interpreter follows a procedure quite similar to the procedure for operator
combinations described in section 1.1.3.
• To evaluate a function application, do the following:
1. Evaluate the subexpressions of the application, namely the function expression
and the argument expressions.
2. Apply the function that is the value of the function expression to the values of
the argument expressions.
square(2 + 5);
49
Here, the argument expression is itself a compound expression, the operator combi-
nation 2 + 5.
7. Throughout this book, we will describe the general syntax of expressions by using italic
symbols—e.g., name—to denote the “slots” in the expression to be filled in when such an
expression is actually used.
8. More generally, the body of the function can be a sequence of statements. In this case, the
interpreter evaluates each statement in the sequence in turn until a return statement determines
the value of the function application.
10 Chapter 1 Building Abstractions with Functions
square(square(3));
81
Of course function application expressions can also serve as argument expressions.
We can also use square as a building block in defining other functions. For
example, x2 + y2 can be expressed as
square(x) + square(y)
We can easily declare a function sum_of_squares9 that, given any two numbers as
arguments, produces the sum of their squares:
function sum_of_squares(x, y) {
return square(x) + square(y);
}
sum_of_squares(3, 4);
25
Now we can use sum_of_squares as a building block in constructing further
functions:
function f(a) {
return sum_of_squares(a + 1, a * 2);
}
f(5);
136
In addition to compound functions, any JavaScript environment provides prim-
itive functions that are built into the interpreter or loaded from libraries. Besides
the primitive functions provided by the operators, the JavaScript environment used
in this book includes additional primitive functions such as the function math_log,
which computes the natural logarithm of its argument.10 These additional primitive
functions are used in exactly the same way as compound functions; evaluating the
application math_log(1) results in the number 0. Indeed, one could not tell by
looking at the definition of sum_of_squares given above whether square was built
into the interpreter, loaded from a library, or defined as a compound function.
9. The way multi-part names such as sum_of_squares are written affects the readability of
programs, and programming communities differ on this. According to the common JavaScript
convention, called camel case, the name would be sumOfSquares. The convention used in this
book is called snake case, and was chosen for its closer resemblance to the convention used in
the Scheme version of this book, where hyphens play the role of our underscores.
10. Our JavaScript environment includes all functions and constants of ECMAScript’s Math
object, under the names math_. . .. For example, ECMAScript’s Math.log is available as
math_log. The MIT Press web page for this book includes the JavaScript package sicp that
provides these and all other JavaScript functions that are considered primitive in the book.
1.1.5 The Substitution Model for Function Application 11
1.1.5 The Substitution Model for Function Application
To evaluate a function application, the interpreter follows the process described in
section 1.1.4. That is, the interpreter evaluates the elements of the application and ap-
plies the function (which is the value of the function expression of the application) to
the arguments (which are the values of the argument expressions of the application).
We can assume that the application of primitive functions is handled by the in-
terpreter or libraries. For compound functions, the application process is as follows:
• To apply a compound function to arguments, evaluate the return expression of the
function with each parameter replaced by the corresponding argument.11
To illustrate this process, let’s evaluate the application
f(5)
where f is the function declared in section 1.1.4. We begin by retrieving the return
expression of f:
sum_of_squares(a + 1, a * 2)
Then we replace the parameter a by the argument 5:
sum_of_squares(5 + 1, 5 * 2)
Thus the problem reduces to the evaluation of an application with two arguments and
a function expression sum_of_squares. Evaluating this application involves three
subproblems. We must evaluate the function expression to get the function to be
applied, and we must evaluate the argument expressions to get the arguments. Now
5 + 1 produces 6 and 5 * 2 produces 10, so we must apply the sum_of_squares
function to 6 and 10. These values are substituted for the parameters x and y in the
body of sum_of_squares, reducing the expression to
square(6) + square(10)
If we use the declaration of square, this reduces to
(6 * 6) + (10 * 10)
which reduces by multiplication to
36 + 100
and finally to
136
11. If the body of the function is a sequence of statements, the body is evaluated with the
parameters replaced, and the value of the application is the value of the return expression of the
first return statement encountered.
12 Chapter 1 Building Abstractions with Functions
The process we have just described is called the substitution model for function
application. It can be taken as a model that determines the “meaning” of function
application, insofar as the functions in this chapter are concerned. However, there
are two points that should be stressed:
• The purpose of the substitution is to help us think about function application, not
to provide a description of how the interpreter really works. Typical interpreters
do not evaluate function applications by manipulating the text of a function to sub-
stitute values for the parameters. In practice, the “substitution” is accomplished
by using a local environment for the parameters. We will discuss this more fully in
chapters 3 and 4 when we examine the implementation of an interpreter in detail.
• Over the course of this book, we will present a sequence of increasingly elaborate
models of how interpreters work, culminating with a complete implementation
of an interpreter and compiler in chapter 5. The substitution model is only the
first of these models—a way to get started thinking formally about the evaluation
process. In general, when modeling phenomena in science and engineering, we
begin with simplified, incomplete models. As we examine things in greater detail,
these simple models become inadequate and must be replaced by more refined
models. The substitution model is no exception. In particular, when we address in
chapter 3 the use of functions with “mutable data,” we will see that the substitu-
tion model breaks down and must be replaced by a more complicated model of
function application.12
Applicative order versus normal order
According to the description of evaluation given in section 1.1.4, the interpreter
first evaluates the function and argument expressions and then applies the resulting
function to the resulting arguments. This is not the only way to perform evaluation.
An alternative evaluation model would not evaluate the arguments until their values
were needed. Instead it would first substitute argument expressions for parameters
until it obtained an expression involving only operators and primitive functions, and
would then perform the evaluation. If we used this method, the evaluation of
f(5)
would proceed according to the sequence of expansions
sum_of_squares(5 + 1, 5 * 2)
square(5 + 1) + square(5 * 2)
(5 + 1) * (5 + 1) + (5 * 2) * (5 * 2)
12. Despite the simplicity of the substitution idea, it turns out to be surprisingly complicated
to give a rigorous mathematical definition of the substitution process. The problem arises from
the possibility of confusion between the names used for the parameters of a function and the
(possibly identical) names used in the expressions to which the function may be applied. Indeed,
there is a long history of erroneous definitions of substitution in the literature of logic and
programming semantics. See Stoy 1977 for a careful discussion of substitution.
1.1.6 Conditional Expressions and Predicates 13
followed by the reductions
6 * 6 + 10 * 10
36 + 100
136
This gives the same answer as our previous evaluation model, but the process is
different. In particular, the evaluations of 5 + 1 and 5 * 2 are each performed
twice here, corresponding to the reduction of the expression
x * x
with x replaced respectively by 5 + 1 and 5 * 2.
This alternative “fully expand and then reduce” evaluation method is known
as normal-order evaluation, in contrast to the “evaluate the arguments and then
apply” method that the interpreter actually uses, which is called applicative-order
evaluation. It can be shown that, for function applications that can be modeled using
substitution (including all the functions in the first two chapters of this book) and
that yield legitimate values, normal-order and applicative-order evaluation produce
the same value. (See exercise 1.5 for an instance of an “illegitimate” value where
normal-order and applicative-order evaluation do not give the same result.)
JavaScript uses applicative-order evaluation, partly because of the additional ef-
ficiency obtained from avoiding multiple evaluations of expressions such as those
illustrated with 5 + 1 and 5 * 2 above and, more significantly, because normal-
order evaluation becomes much more complicated to deal with when we leave the
realm of functions that can be modeled by substitution. On the other hand, normal-
order evaluation can be an extremely valuable tool, and we will investigate some of
its implications in chapters 3 and 4.13
1.1.6 Conditional Expressions and Predicates
The expressive power of the class of functions that we can define at this point is very
limited, because we have no way to make tests and to perform different operations
depending on the result of a test. For instance, we cannot declare a function that com-
putes the absolute value of a number by testing whether the number is nonnegative
and taking different actions in each case according to the rule
|x| =

x if x ≥ 0
–x otherwise
This construct is a case analysis and can be written in JavaScript using a conditional
expression as
13. In chapter 3 we will introduce stream processing, which is a way of handling apparently “in-
finite” data structures by incorporating a limited form of normal-order evaluation. In section 4.2
we will modify the JavaScript interpreter to produce a normal-order variant of JavaScript.
14 Chapter 1 Building Abstractions with Functions
function abs(x) {
return x = 0 ? x : - x;
}
which could be expressed in English as “If x is greater than or equal to zero, return x;
otherwise return –x.” The general form of a conditional expression is
predicate ? consequent-expression : alternative-expression
Conditional expressions begin with a predicate—that is, an expression whose value
is either true or false, two distinguished boolean values in JavaScript. The primi-
tive boolean expressions true and false trivially evaluate to the boolean values
true and false, respectively. The predicate is followed by a question mark, the
consequent-expression, a colon, and finally the alternative-expression.
To evaluate a conditional expression, the interpreter starts by evaluating the
predicate of the expression. If the predicate evaluates to true, the interpreter eval-
uates the consequent-expression and returns its value as the value of the conditional.
If the predicate evaluates to false, it evaluates the alternative-expression and returns
its value as the value of the conditional.14
The word predicate is used for operators and functions that return true or false,
as well as for expressions that evaluate to true or false. The absolute-value function
abs makes use of the primitive predicate =, an operator that takes two numbers as
arguments and tests whether the first number is greater than or equal to the second
number, returning true or false accordingly.
If we prefer to handle the zero case separately, we can specify the function that
computes the absolute value of a number by writing
|x| =



x if x  0
0 if x = 0
–x otherwise
In JavaScript, we express a case analysis with multiple cases by nesting conditional
expressions as alternative expressions inside other conditional expressions:
function abs(x) {
return x  0
? x
: x === 0
? 0
: - x;
}
Parentheses are not needed around the alternative expression x === 0 ? 0 : - x,
because the conditional-expression syntactic form is right-associative. The inter-
preter ignores spaces and line breaks, here inserted for readability to align the ?’s
and :’s under the first predicate of the case analysis. The general form of a case
analysis is
14. Conditionals in full JavaScript accept any value, not just a boolean, as the result of evaluat-
ing the predicate expression (see footnote 14 in section 4.1.3 for details). The programs in this
book use only boolean values as predicates of conditionals.
1.1.6 Conditional Expressions and Predicates 15
p1
? e1
: p2
? e2
.
.
.
: pn
? en
: final-alternative-expression
We call a predicate pi together with its consequent expression ei a clause. A case
analysis can be seen as a sequence of clauses, followed by a final alternative ex-
pression. According to the evaluation of conditional expressions, a case analysis
is evaluated by first evaluating the predicate p1. If its value is false, then p2 is
evaluated. If p2’s value is also false, then p3 is evaluated. This process continues
until a predicate is found whose value is true, in which case the interpreter returns
the value of the corresponding consequent expression e of the clause as the value of
the case analysis. If none of the p’s is found to be true, the value of the case analysis
is the value of the final alternative expression.
In addition to primitive predicates such as =, , , =, ===, and !== that are
applied to numbers,15 there are logical composition operations, which enable us to
construct compound predicates. The three most frequently used are these:
• expression1  expression2
This operation expresses logical conjunction, meaning roughly the same as the
English word “and.” This syntactic form is syntactic sugar16 for
expression1 ? expression2 : false.
• expression1 || expression2
This operation expresses logical disjunction, meaning roughly the same as the
English word “or.” This syntactic form is syntactic sugar for
expression1 ? true : expression2.
• ! expression
This operation expresses logical negation, meaning roughly the same as the En-
glish word “not.” The value of the expression is true when expression evaluates to
false, and false when expression evaluates to true.
Notice that  and || are syntactic forms, not operators; their right-hand expression
is not always evaluated. The operator !, on the other hand, follows the evaluation
rule of section 1.1.3. It is a unary operator, which means that it takes only one
argument, whereas the arithmetic operators and primitive predicates discussed so
far are binary, taking two arguments. The operator ! precedes its argument; we call
it a prefix operator. Another prefix operator is the numeric negation operator, an
example of which is the expression - x in the abs functions above.
15. For now, we restrict these operators to number arguments. In sections 2.3.1 and 3.3.1, we
shall generalize the equality and inequality predicates === and !==.
16. Syntactic forms that are simply convenient alternative surface structures for things that can
be written in more uniform ways are sometimes called syntactic sugar, to use a phrase coined
by Peter Landin.
16 Chapter 1 Building Abstractions with Functions
As an example of how these predicates are used, the condition that a number x
be in the range 5  x  10 may be expressed as
x  5  x  10
The syntactic form  has lower precedence than the comparison operators  and ,
and the conditional-expression syntactic form · · · ?· · · :· · · has lower precedence
than any other operator we have encountered so far, a property we used in the abs
functions above.
As another example, we can declare a predicate to test whether one number is
greater than or equal to another as
function greater_or_equal(x, y) {
return x  y || x === y;
}
or alternatively as
function greater_or_equal(x, y) {
return ! (x  y);
}
The function greater_or_equal, when applied to two numbers, behaves the same
as the operator =. Unary operators have higher precedence than binary operators,
which makes the parentheses in this example necessary.
Exercise 1.1
Below is a sequence of statements. What is the result printed by the interpreter in response
to each statement? Assume that the sequence is to be evaluated in the order in which it is
presented.
10;
5 + 3 + 4;
9 - 1;
6 / 2;
2 * 4 + (4 - 6);
const a = 3;
const b = a + 1;
a + b + a * b;
a === b;
b  a  b  a * b ? b : a;
a === 4
? 6
: b === 4
? 6 + 7 + a
: 25;
1.1.6 Conditional Expressions and Predicates 17
2 + (b  a ? b : a);
(a  b
? a
: a  b
? b
: -1)
*
(a + 1);
The parentheses around the conditional expressions in the last two statements are necessary
because the conditional-expression syntactic form has lower precedence than the arithmetic
operators + and *.
Exercise 1.2
Translate the following expression into JavaScript
5 + 4 + 2 – 3 – (6 + 4
5 )

3(6 – 2)(2 – 7)
Exercise 1.3
Declare a function that takes three numbers as arguments and returns the sum of the squares
of the two larger numbers.
Exercise 1.4
Observe that our model of evaluation allows for applications whose function expressions
are compound expressions. Use this observation to describe the behavior of a_plus_abs_b:
function plus(a, b) { return a + b; }
function minus(a, b) { return a - b; }
function a_plus_abs_b(a, b) {
return (b = 0 ? plus : minus)(a, b);
}
Exercise 1.5
Ben Bitdiddle has invented a test to determine whether the interpreter he is faced with is
using applicative-order evaluation or normal-order evaluation. He declares the following
two functions:
function p() { return p(); }
function test(x, y) {
return x === 0 ? 0 : y;
}
Then he evaluates the statement
test(0, p());
What behavior will Ben observe with an interpreter that uses applicative-order evaluation?
What behavior will he observe with an interpreter that uses normal-order evaluation? Ex-
plain your answer. (Assume that the evaluation rule for conditional expressions is the
18 Chapter 1 Building Abstractions with Functions
same whether the interpreter is using normal or applicative order: The predicate expres-
sion is evaluated first, and the result determines whether to evaluate the consequent or the
alternative expression.)
1.1.7 Example: Square Roots by Newton’s Method
Functions, as introduced above, are much like ordinary mathematical functions.
They specify a value that is determined by one or more parameters. But there is
an important difference between mathematical functions and computer functions.
Computer functions must be effective.
As a case in point, consider the problem of computing square roots. We can
define the square-root function as
√
x = the y such that y ≥ 0 and y2
= x
This describes a perfectly legitimate mathematical function. We could use it to
recognize whether one number is the square root of another, or to derive facts
about square roots in general. On the other hand, the definition does not describe
a computer function. Indeed, it tells us almost nothing about how to actually find the
square root of a given number. It will not help matters to rephrase this definition in
pseudo-JavaScript:
function sqrt(x) {
return the y with y = 0  square(y) === x;
}
This only begs the question.
The contrast between mathematical function and computer function is a reflec-
tion of the general distinction between describing properties of things and describing
how to do things, or, as it is sometimes referred to, the distinction between declara-
tive knowledge and imperative knowledge. In mathematics we are usually concerned
with declarative (what is) descriptions, whereas in computer science we are usually
concerned with imperative (how to) descriptions.17
How does one compute square roots? The most common way is to use Newton’s
method of successive approximations, which says that whenever we have a guess y
17. Declarative and imperative descriptions are intimately related, as indeed are mathematics
and computer science. For instance, to say that the answer produced by a program is “correct”
is to make a declarative statement about the program. There is a large amount of research aimed
at establishing techniques for proving that programs are correct, and much of the technical
difficulty of this subject has to do with negotiating the transition between imperative statements
(from which programs are constructed) and declarative statements (which can be used to deduce
things). In a related vein, programming language designers have explored so-called very high-
level languages, in which one actually programs in terms of declarative statements. The idea
is to make interpreters sophisticated enough so that, given “what is” knowledge specified by
the programmer, they can generate “how to” knowledge automatically. This cannot be done in
general, but there are important areas where progress has been made. We shall revisit this idea
in chapter 4.
Random documents with unrelated
content Scribd suggests to you:
nicht gekämpft um das ferne Ziel. Und da er ein Mann ward, sah er
wieder einen offenen Weg vor sich; aber er war wieder umgekehrt,
um anderer Menschen willen und um unklares Fühlen. Und zuletzt
war die Frau in sein Leben getreten, die zu ihm gehörte, und er
hatte es gar nicht gemerkt.
Es war so, als kämen die zahllosen Stimmen aus dem raunend-
platschenden Hinfließen und sagten es ihm alles in Worten. Noch nie
war dies in deutlichem Denken in seiner Seele wach geworden. Und
er sann und quälte sich und sann, wie es so gekommen war. — Er
war immer so vor sich hingegangen im trüben Licht und hatte
gewartet und geträumt und wieder gewartet in den weißen Nebel
hinein. Der Nebel war es gewesen, der hatte es zugedeckt. Und nun
war alles falsch und wirr.
Konnte er es denn ertragen, dies öde Leben, und ohne sie? Er
hatte sich wieder an den Boden gelegt. Er deckte den Arm über die
Augen. „Ich kann nicht,“ murmelte er.
Ganz, ganz leise fing es an, zwischen den trockenen Blättern zu
rascheln und klappern. Dann kam ein leises, gleichförmiges Tröpfeln.
Der Nebel war zum Regen geworden. Reicher, satter wurden die
Farben in der Feuchtigkeit. Es kam ein farbiges Gleißen über die
reglosen Blätter und die ernsten Stämme. Und geheimnisvoll wie das
Rinnen des Baches klang das gleichmäßig leise, klappernde Tropfen.
War denn nirgends ein starkes Frisches, nach dem er hinsehen
konnte und aufstehen und vorwärtsgehen? Er merkte nichts von der
großen Ordnung. Das war ein schöner Traum gewesen, den sich der
alte Fischer zurecht gesponnen hatte. Es war alles wirr.
Und das murmelnde Fließen rann und rann wie ein endlos
mühseliges Gespinst. — Und das öde Getropfe webte ringsum mit
sachtem Rascheln. Aber aus der alten Erde stieg ein feuchter Duft,
und es war, als ob ein Trieb der Stärke mit aufquoll aus dem dunklen
Grunde. In dem reglos Liegenden wuchs das Wollen aus den Tiefen
seines Wesens herauf. — Es ist ein Wundersames um die Kraft, wie
sie dem Mutterherzen der alten Erde entströmt. — Lars stand auf,
und er sah mit dunklen Augen fest vor sich hin. Noch war er ein
freier Mann, und er wollte das Leben fest anpacken. Nur eines
konnte er nicht: Karen lassen. Dies starke, treue Herz, das sein
innerstes, wirres Wesen verstand, die mußte ihm helfen. Vielleicht,
daß noch irgendwo eine Arbeit auf ihn wartete, und wie von
ungefähr stieg Christen Matthies’ trauriges Gesicht in seiner Seele
auf. „Er sollte lieber den kleinen Leuten helfen, wenn er so klug ist,“
hatte Christen Matthies gesagt.
So ging er durch den leise rinnenden Regen nach Hause.
[5] Kleiner Bursch.
Kapitel XXIV
Die Asmussens waren durch Trinas lange Krankheit
zurückgekommen. Anstatt wie sonst Geld auf die Sparkasse tragen
zu können, hatten sie Geld aufnehmen müssen. Das machte Lars
mißmutig. Und das ewige Gejammer der alten Lassen darüber
machte es nur noch ärger. Seit der Stunde im Walde war es wie eine
wunde Stelle irgendwo in seiner Seele, und das Reden und das laute
Lachen trafen darauf wie Peitschenhiebe. Da ging er ins Wirtshaus,
und es war ihm selbst kaum bewußt, daß es der Gedanke aus dem
Walde war, der ihn hintrieb.
Er setzte sich gleich zu Christen Matthies und wollte mit ihm
reden über die neue Vereinigung, wie sie die Fischer in den andern
Buchten hatten. Aber Christen Matthies war dänisch gesonnen,
darum fuhr ihn Lars bald heftig und hochfahrend an. Da sah Christen
mit den schwermütigen alten Augen fragend zu ihm auf und gab
bald keine Antwort mehr.
„Ja, wenn wir die Fische mit einem eigenen Dampfer zur Stadt
bringen sollen, wie die andern, woher sollen wir das Geld dann für
einen Dampfer nehmen?“ fragte da Trollsen dazwischen, „Christen
Matthies hat recht, wenn wir uns zu den Dänen halten, kriegen wir
Geld zu viel billigeren Prozenten.“
Aber in Lars war die wunde Unrast, darum konnte er ihnen nicht
in Ruhe klar machen, wie er es meinte, sondern geriet in Zorn. Da
schüttelten sie die Köpfe über ihn und hörten nicht mehr hin. Und
bald stand er auf und ging hinaus. Er trat aus dem Dunst in den
stillen, klaren Herbstabend hinaus. Es hatte sich abgeregnet, und
eine grünleuchtende Klarheit lag über der bunten Herbstwelt.
Es lag eine Dumpfheit über Lars und eine Müdigkeit. — Das war
also auch nichts. Denen würde er ebenso wenig helfen können, wie
sich selbst. Er sehnte sich nach einem stillen Winkel, darum ging er
zu Mutter Stina in die alte Heimhütte.
Zwischen den hohen, bunten Malven lag das kleine,
grünbemooste Strohdachhaus wie im tiefen Schlaf, als hätte es über
seinem leisen, traulichen Klingen sich und die Welt vergessen und
wäre nun auch vergessen worden zwischen seiner bunt-blühenden
Pracht.
Mutter Stina saß allein mit ihrem Strickzeug, und über dem alten
Gesicht lag es fast wie Kirchhofsruhe. — Sie fragte auch nichts. Sie
ließ ihn still da sitzen und vor sich hin sehn. Dann ging sie in die
Küche und holte ihm zu essen. Und als es dunkel wurde, ging er
wieder nach Hause, und sie wagten ihn dort alle nicht zu fragen, wo
er gewesen war.
* *
*
Und nun kamen böse Tage für Lars Asmussen. Alles Ding war
zwecklos und hatte seinen Sinn verloren, und nur der scharfe
Schmerz von den harten, lauten Stimmen weckte ihn hier und da zur
Wirklichkeit. Und alle Arbeit, die mit Unlust und halber Kraft getan
ist, bringt kein Glück. So ging es in diesen Wochen rückwärts mit
den Asmussens. Manchmal wollte Lars sich aufraffen. Dann dachte
er an Karen. Er meinte immer, sie müsse ihm zum Rechten helfen
können. Und dann suchte er sie zu treffen. Aber Karen wich ihm aus
seit der Stunde im Walde. Und wenn sie einmal zusammentrafen,
war ihm, als tue er eine Sünde, und er schämte sich hinterher vor
Trina, und ihr Lachen reizte ihn nur noch mehr. So kam es, daß,
wenn Lars und Karen zusammen waren, sie nichts davon hatten,
sondern etwas Verstecktes, Unnatürliches zwischen ihnen lag, und
sie es beide empfanden wie einen Schmerz. Aber doch lebte Lars nur
für die kurzen, flüchtigen Augenblicke. Karen aber trachtete
heimlich, eine andere Stelle anzunehmen. Doch sie wußte, daß Frau
Lind sie nicht hergeben wollte. Sie ging ihr im Haushalte zur Hand,
aber vor allem war sie ihr bei den Kindern unentbehrlich geworden;
denn Jakob Lind hatte sich allmählich ein großes Gartenland
zusammengekauft, und Frau Lind hatte viel zu tun. Die vier kleinen
Kinder aber hingen an Karen. Und Karen waren sie ans Herz
gewachsen, daß sie sich auch nicht schnell zum Scheiden
entschließen konnte.
So zogen sich die trübseligen, unfruchtbaren Wintertage hin.
Wo im Walde ein krankes Stück sich verbirgt, da stürzen sich die
starken und gesunden darauf und forkeln[6] es zu Tode. Und die
Menschenherde ist nicht besser als das Wild. — Die Männer
witterten es, wie die Tiere wittern, daß etwas Krankes am starken,
klugen Lars Asmussen war. Etwas, das nicht mitklang bei ihren
Scherzen und das sich zusammenzog, wenn sie darauf schlugen.
Eben eine Schwäche war da. Und darum schlugen sie darauf. Und
wenn einer schlug, so schlugen sie alle. Sie dachten nicht darüber
nach. Sie hatten nur Lust, so zu tun.
Aber es war noch eins, das traf ihn empfindlicher als das andere
alles. Peter hatte sich gegen ihn gekehrt. Lars’ lässiges Arbeiten
hemmte auch ihn. Und er hatte keine Geduld mit seiner unlustigen
Art. — Auch schämte er sich seiner Schwester. Ihre ganze Art mit
dem sinnlos dummen Lachen lag auf Peter wie eine Schande. Und er
war hart gegen Trina Asmussen, wenn er sie traf.
Und Peters unfreundliches Wesen verschüchterte sie ganz. —
Daß ihre Art auf Lars lastete und ihn hemmte, empfand Peter wohl,
und er wäre Lars gern aus dem Wege gegangen deshalb. Stunde um
Stunde aber band sie die Arbeit zusammen auf dem einsamen Meer.
Und da wurde er hart gegen Lars und fuhr ihn zornig an, weil Lars
ihm war wie ein Vorwurf, und er sich nicht zu helfen wußte in seinem
Unbehagen. — Daß Lars es jetzt mit so vielen hielt, war ihm immer
zuwider gewesen. Aber heimlich war er doch stolz darauf, daß die
Männer ringsum auf Lars’ Worte hörten und zu ihm aufsahen. Da sie
aber von ihm ließen und mit harten Worten nach ihm warfen, da
fühlte Peter, daß Lars im Unrecht gewesen war, und in seinem Zorn
und in seiner Härte hatte er etwas Verächtliches gegen ihn.
Und es kam ein böser Wintersonntag, an dem der eisig feuchte
Wind und die endlos kalte Öde den Menschen bis tief in die Brust
hineinlangten und das bißchen Lust und Hoffnung herauszerrten und
hinstreuten über das weite, graue Meer.
Lars ging allein am Strande entlang nach Wanbyll, und wieder
sagte irgend etwas in ihm: „Ich k a n n nicht“. Aber diesmal sagte er
es nicht laut; denn seine Lippen waren aufeinandergepreßt, und der
harte Zug saß fest um den Mund.
Der rote Trollsen wagte sich am kecksten an ihn heran und
spöttelte offen über den Spaßverderber. Einige von den Männern um
den rohen Holztisch zogen den Mund breit und sahen sich an.
Da lachte Lars hart auf und stürzte ein Glas Grog hinunter. Es
war kalt, und das heiße, betäubende Prickeln tat ihm wohl. Da
forderte er ein zweites und ein drittes, und es war, als versinke das
finstere Elend um ihn her, und ein wohliges Vergessen käme über
ihn. Da lachte er wild auf und forderte immer mehr. Und er hörte es
erst am nächsten Tage, daß er zu Hause geschleppt worden sei.
[6] Mit dem Geweih stoßen.
Kapitel XXV
Trina hatte manchmal Näharbeiten übernommen. Sie hatte das
Nähen bei Frau Asmussen gut gelernt. Jetzt hatte sie es wieder
aufgenommen. Mit ihrer Hände Arbeit schaffte sie manches für Lars
heran, was ihm sonst gefehlt hätte. Denn in dieser Zeit tat es not,
daß noch etwas Geld verdient wurde. Auch die Linds gaben ihr
manchmal etwas zu tun. Karen hatte die Arbeit öfter zu ihr
hingetragen. Aber jetzt ging sie nur zu der Zeit, wenn die Fischer auf
See waren.
Es war ein früher Märztag. In der Luft lag das Geheimnis. —
Kahle Zweige ragten in die graue Luft, und öde, graue Flächen
dehnten sich über die Koppeln. Und doch lag das Geheimnis in der
Luft. Ein weiches Flügeln und Streicheln huschte über die Dinge und
tastete sich bis in die Menschenherzen hinein. Und die Lerchen trieb
es hinauf — hinauf und drängte und weitete die kleine Brust, daß sie
sich Luft schaffen mußten in zwitscherndem Gejubel und die Flügel
regten im Takt, immer hinauf in das weiche Grau.
Denn die Lerchen glaubten an das Licht hinter den Wolken. —
Oben auf der Koppel, von wo der freie Blick über das Wasser
geht, stand Karen und horchte hinauf nach den Lerchen. Ihre hohe,
schlanke Gestalt stand dunkel vor der Luft, aber es war etwas Helles
auf ihrer Stirn.
Karen war aufrecht ihres Weges gegangen, und keiner hatte über
sie zu klagen gehabt. Da war nichts Zerdrücktes, Schwächliches an
ihr. Ihre Last hob sie auf und deckte sie sorglich mit ihrem Stolze zu
und ging damit vorwärts mit gehobenem Haupt.
Aber das Weiche, Tastende in der Luft hemmte ihr frisches
Vorwärtsschreiten, daß sie sinnend einhalten mußte und
hinaufhorchen nach den Lerchen und in sich hinein. Und die
Gedanken stiegen auf und lagen auf ihrer Stirn, daß sie die Brauen
zusammenzog über den hellen Augen und langsam weiterging, den
Blick am steinigen Wege. Sie konnte und konnte es nicht verstehn.
Warum saß diese Liebe ihr so grundtief im Herzen, daß sie sich
selbst nicht denken konnte ohne diese Liebe? — Es hatte doch alles
Ding einen Sinn im wundersamen Weltgefüge. Wo war er hier?
Warum konnte sie nicht einen andern lieben? — Es gab tüchtige,
starke Männer genug um sie her, und sie hätten die Arme weit
aufgemacht für dies stolze, frische, junge Leben. Dann wäre sie
reich geworden. Eigenes, zartes, junges Sein hätte sie an der Brust
gewiegt. Und wie Siegesstolz wäre des Weibes höchste Lust ihr
aufgegangen, wenn rote Kinderlippen sie Mutter nannten.
Aber es hätte alles angefangen mit einer großen Lüge.
Sich ohne Liebe zu geben, dazu sagte ihr ganzes Wesen „Nein“.
Und ihre Liebe wohnte bei dem einen, für den sie zwecklos war in
dieser rätselvollen Welt.
Und Karen setzte die Füße fest auf, als wollte sie die grübelnden
Gedanken unter sich treten. Da sah sie die Fischerhäuser vor sich
liegen, und sie atmete tief auf. Sie mußte irgendwo zugreifen —
vielleicht daß sie ihm helfen könnte durch die Frau. Sie mußte eben
aufhorchen und achten, wenn der Augenblick kam, daß diese
stumme Liebe zur Tat werden konnte.
Da stand sie vor dem Hause und schob die Gartentür auf. Mutter
Lassens laute Stimme fiel ihr schrill entgegen, daß sie zurückstutzte.
Denn dieses Volk zwischen den großen, stillen Weiten hat oft einen
Abscheu vor dem Lauten und Rohen. Und Karen war auf einem
einsamen Hofe ausgewachsen zwischen schweigsamen Leuten.
Dann trat sie rasch über die Schwelle, aber in ihrer Art war etwas
Gezwungenes. Und wie sie Trina ansprach, fühlte die es gleich, und
das laute, breite Lachen grüßte Karen wie ein Schlag.
Da ging es wie ein kühler Hauch über ihr Wesen, und im harten
Kampf gegen ihre Art bekamen die klaren, hellen Augen fast etwas
Hochmütiges. Das verwirrte Trina nur mehr, daß sie nicht verstand,
was Karen von ihr wollte, und ihre Art immer unsicherer und
alberner wurde. Und dazwischen kam immer wieder das laute
Lachen und breitete Trinas Gesicht, bis das Rohe es fast unkenntlich
machte. Es war Karen fast unheimlich, mit ihr zu reden, und sie
wandte sich an Mutter Lassen mit ihrem Auftrage. Die stemmte die
Arme ein und kam diensteifrig heran, und ihr Gesicht legte sie in
würdige Falten. Aber der Gedanke, daß diese zwei zu Lars gehörten,
stieg in Karen auf wie ein zorniger Widerwillen. Mutter Lassens
schwatzender Bereitwilligkeit antwortete sie mit knappen Worten,
und in den Worten und den hellen Augen lag es immer wie
Hochmut.
Dann wandte sie sich nach der Tür, und ihr Abschied von den
beiden war wie eine Flucht.
Sie ging langsam über die Koppeln hinauf; denn seit dem Tode
der Eltern hatte noch niemals so schwere Last auf ihr geruht wie
heute. Und bei jedem Schritt stieg deutlicher das Bewußtsein von
ihrer eigenen hochmütigen Kälte in ihr auf. Es war fast unerträglich,
diese wachsende Scham. Und all das ahnungsjunge Frühlingshoffen
von vorhin ward daneben wie ein lächerlicher Hohn.
Sie kam am Waldesrand entlang. — Und tief aus den kahlen,
dämmerigen Tiefen zog ein Klingen hinaus in die weiche, graue Luft.
Es legte sich um das Menschenherz wie unsagbares Sehnen nach
unerreichbarem Licht, und wieder wie ein zartes wachsendes Hoffen
auf wunderlich-rätselvoll Verborgenes, ein Aufquellen aus
geheimnisvollen Gründen, ein jauchzendes Erschauen und dann ein
zart verklingendes, ahnungsvolles Hoffen.
Es war die erste Drossel, die Karen in diesem grauen Vorfrühling
sang. Und sie legte die Hand über die Augen, und ihre Seele ging
langsam Schritt um Schritt aus ihrer eigenen Unrast hin zu der
hellen, rauschenden Quelle, aus der sie sich schon so oftmals junge,
freie Kraft geschöpft hatte.
Im Flecken traf sie Jakob Lind. Der hatte gehört, daß Lars in den
letzten Wochen oft betrunken gewesen war.
Aber sie sprachen nicht über das, was sie drückte, diese beiden.
—
Jakob Lind und Karen gingen schweigsam den Weg nach Aalby
nach Hause. Und das weiche, tastende Geheimnis aus der grauen
Luft strich ihnen leise über die ernsten Stirnen.
Karen versuchte es noch ein paarmal, wenn Frau Lind Näharbeit
zu Trina Asmussen besorgt haben wollte. Es gelang ihr auch wohl,
daß die kühle, fast hochmütige Art aus ihrem Wesen fern blieb. Aber
sie kam darum doch nicht viel weiter mit Klein-Trina, und sie fühlte
wohl, daß noch etwas wie ein Widerwillen in ihrem Herzen saß
gegen die arme Kranke.
Kapitel XXVI
Jakob Lind konnte Lars’ nicht habhaft werden. Er ging ihm nun
schon seit vielen Wochen mit finsterm Gesicht aus dem Wege. Da
kam ein Tag, an dem sich Peter an der Hand verletzt hatte und ein
paar Tage aussetzen mußte mit der Arbeit. Jakob Lind hatte davon
gehört, und er ging nach Mutter Stinas Strohdachhaus, und in
seinem Kopf steckte ein Plan.
Die beiden Fischer saßen dort auf ihren alten Plätzen. Aber ihre
ärgerlich-harten Stimmen klangen ungewohnt unter dem niedrigen
Dach hervor. Sie saßen mit den Mützen in die Stirn gerückt und
sahen jeder in eine Ecke, und über Mutter Stinas stillem Gesicht lag
der Kummer wie eine schwere Last und hatte mit harter Schrift
unzählig tiefe Linien hineingegraben.
Sie rührten sich alle kaum, als Jakob Lind eintrat, und grüßten
ihn nur mit den Augen. — Er fragte nach Peters Hand, und wen Lars
zum Ersatz in seinem Boot hätte heute nacht. Denn die Luft war
milde und still und günstig zum Fischen. Lars gab eine mürrische
Antwort, weil er niemand hatte, denn im Sommer arbeiteten die zwei
andern nicht mit ihnen. Da blitzte es fast lustig auf in Jakobs Augen.
„So nimm mich mit, Lars, ich möchte einmal helfen.“
Da sahen sie wirklich aus ihren Ecken heraus und sahen sich an,
und beide Fischer lachten halblaut vor sich hin. „Das wird wohl
schwer halten, Herr Lehrer,“ sagte Peter, und er hatte etwas
Mitleidiges dabei.
„Du kannst mich ja pullen lassen, Lars; das Auswerfen verstehe
ich wohl nicht. Aber für einmal schaffe ich es wohl, mit dem Netz
einziehn, wenn du mir’s zeigst. Und ich habe eben Lust dazu.“
Da sah ihn Lars sonderbar an und schwieg eine Weile. „Na, denn
man zu, Jakob,“ sagte er endlich mit tiefer Stimme.
„Peter borgt mir wohl sein Zeug,“ sagte Jakob Lind.
„Es wird ein bißchen groß sein, Herr Lehrer.“ — Und in Peters
Stimme saß ein verhaltenes Lachen.
Es war eine von den wunderlichen, milden Nächten. Hier und da
glitten die Wolken zur Seite, und durch graue Dünste goß der Mond
ein zitterig rotes Scheinen über die Welt. Aus der frühlingsatmenden
Erde stieg ein reiches, schweres Duften wie ein aufquellend-
sehnendes Leben. — Aber rings in der lautlos samtweichen
Dunkelheit lag es wie seltsam schlummernde Dinge, wartend, aus
ihrem leisen Schlafe aufzustehn und in das rötliche Geschimmer
hinzutreten.
Merkwürdig laut klangen die Tritte der schweigsamen Männer auf
den Brettern des Ricks. Und dann kam der Ton der Riemen in den
Dollen und das leise, gleichmäßige Platschen. Das paßte sich hinein
in das große Schweigen und ward selbst ein Klang der raunend-
dunklen Heimlichkeit.
Es dauerte eine lange Zeit, dies schweigende Hingleiten. Aber
endlich seufzte Jakob auf und nahm seinen Blick von der breiten,
glitzerigen Flimmerstraße über den Wellen fort. Eine Weile sah er auf
die dunkle Gestalt an den Riemen und ihr gleichmäßig schweigendes
Tun. — „Lars, es ist ja nur der eine Ruck, Mensch, daß du aus dir
herauskommst, nachher ist dir leichter; das weißt du!“
„Es nützt doch nichts, Jakob. Es ist doch einmal alles verwirrt, am
besten, man beißt die Zähne zusammen und schweigt.“ Und Lars
sah wieder gerade vor sich hin.
„Aus dem Ärgsten hast du dich schon herausgewühlt, Lars, ich
weiß es. Seit fast zwei Monaten warst du nicht im Wirtshaus. Du bist
schon den ersten Schritt den neuen höheren Berg hinauf. Warum
redest du denn davon, daß es alles nichts nützt?“
„Weil ich nicht mehr an den Berg glauben kann, Jakob Lind. Es ist
ein ewiges Auf und Ab, weiter nichts!“ Die Stimme klang, als wenn
er aufschrie in seiner Not.
„Seit wann ist denn das so gekommen?“
„Das kann ich dir nicht so sagen, Jakob,“ stockend und stoßweise
sprach er. „Ich habe eben mit einmal gemerkt, daß ich es alles
verpfuscht habe in meinem Leben, und ich hab’ doch eigentlich
immer vorwärts und hinauf gewollt, und wenn das denn doch so
zugelassen wird, dann ist da ja wohl auch alles tot und still hinter
der Welt. Großvater hat sich das alles so schön gedacht, aber das
war wohl nur so ein Spielzeug von ihm, und nun ist er ebenso tot
wie ein Hering oder wie die Mücken von gestern.“
Da waren sie lange still.
Dann seufzte Jakob noch einmal auf und richtete sich ein wenig
hoch, wie mit einem Entschlusse. „Und die Liebe Lars? — Meinst du,
wir wüßten nun nicht endlich, warum Karen nicht heiratet? So eine
große, stille Liebe die gar nichts will und doch festhält, ist die auch
nur in die Welt hineingehagelt ganz zweck- und sinnlos?“
„Das weiß ich nicht, Jakob.“ Und wieder klang das leise,
gleichmäßige Patschen. Und der Mond war verschwunden, und unter
dem Uferschatten lag die weiche, unheimliche Finsternis. —
Da fing er wieder an mit der sonderbaren Stimme, in der die Not
hindurchzitterte.
„W e n n es nur etwas gäbe, Jakob, irgendein Festes, an dem man
es greifen könnte. Wenn ich alles Helle in meinem Leben verpfuscht
und vertrieben habe, meinetwegen. Aber, daß man andere unter
Wasser zieht, daß ich den Leuten nicht mehr helfen kann und dann“
— Lars stockte und zog die Riemen ein und lehnte sich schwer
darauf.
Da beugte sich Jakob ganz vor. „Mensch! Lars, dir ist Kraft
gegeben über die Menschen bei all deiner träumenden Langsamkeit.
Pack’ zu! Schaff’ dir wieder Mut!“
„Ich kann nicht, Jakob, wenn ich denke, es hat alles keinen
Zweck, da ist kein Berg, auf den es sich lohnt, daß ich mich und sie
hinaufschleppe. — Es müßte da e i n Festes sein in dem großen
Tüter. Weißt du eins, an dem man es sieht, daß da eine Ordnung ist
in dem Ganzen und ein Wille dahinter. — Früher, da dachte ich, der
Jesus Christus mit seiner stillen, sicheren Art. Der sagt, daß er von
Gott kommt, und dem kann man es glauben, wenn er sagt, daß er
Gott gesehen hat. — Aber da hab’ ich ein Buch gelesen, da war das
alles klipp und klar bewiesen, daß er sich geirrt hatte und nur ein
ganz gewöhnlicher Mensch war, so ehrlich und treu er auch sonst
sein mochte. Und der Gott, an den er so fest glaubte, soll ihn im
Stich gelassen haben, und mit dem Schrei ist er auch gestorben. —
Na, wenn der sich geirrt hat, dann ist ja doch auch nichts hinter der
wirren Welt, und es ist eben alles gleich.“
„Lars, das läßt sich nicht so ausrechnen, wie die da in dem Buch
geschrieben haben. Wir wissen nur so viel, daß sein bester Freund,
der Tag um Tag mit ihm war, gesagt hat, er war ohne Sünde. Und
das hat auch der allerbeste Freund noch von keinem Menschen
sonst behaupten können. Und sieh mal, Lars, wenn dieser Mensch
ohne Sünde sagt: ‚Wer ihn ansieht, der sieht Gott‘ und er ruft die
ganze, große Menschheit zu sich und will sie allein zu Gott hinführen,
dann muß er wohl wissen, wovon er redet.“
„Du magst ja vielleicht auch recht haben, Jakob, das ist dann
doch auch wohl wieder so ausgeklügelt wie in dem Buch, nur anders
herum. So recht verstehen wie ihr, die ihr euer ganzes Leben daran
herum denkt, können wir einfachen Leute das ja nicht. Aber zum
Weiterkommen hilft das Überlegen wohl nichts.“
„Nein, da hast du ganz recht, Lars. Ich glaube, du mußt dir mal
Mutter Stinas Bibel herunter holen und die alten Geschichten ganz
still für dich allein durchlesen, und dann einfach drauflos leben, so
wie du fühlst, daß es recht ist für dich. Aber dann mußt du
manchmal die Ohren aufmachen und in dich hineinhorchen und um
dich in die wunderliche Welt. Da klingt sie schon herauf, die große
Wahrheit aus der Tiefe. Weißt du, wir Männer sind mehr zum
Anpacken und Vorwärtsschieben gemacht, glaube ich. Aber die
Frauen, die sitzen noch näher an der großen Ordnung fest, von der
Klaas Klaaßen immer sprach. Die hören die Stimmen aus den
heimlichen Tiefen viel lauter. Ich glaube, die können uns helfen
darin!“ —
Dann war Jakob still und wartete. Aber Lars hatte die Tür seiner
Seele wieder zugeschlossen. Er schämte sich, daß er so viel gesagt
hatte. Und Jakobs Reden wollte er gern unterbrechen. Darum gab er
ihm die Riemen und fing an, das Netz auszuwerfen. Jakob fühlte,
daß er genug gesagt hatte, und er trachtete nur noch, wie er Lars
bei der Arbeit helfen könnte. Und die große, stille Nacht war um die
schweigenden Männer. Und leise gluckste das Wasser, und
patschend tropfte es vom Netz und glitzerte im rötlichen Mondlicht.
Und weit draußen tauchten ein paar dunkle rundlich-breite Körper
aus dem Wasser und versanken wieder, um weiterhin
herauszuschnellen, mitten in der flimmerigen Mondesstraße.
„Sieh da, Tümmler,“ sagte Lars. Dann war es wieder still und
einsam.
* *
*
Es war an einem Sonnabend, als Lars und Peter die Fische nach
der Räucherei brachten, daß Trina groß Reinemachen hatte. Es ging
ihr viel besser, und Mutter Lassen hütete jetzt oft tagelang ihren
Enkel in Peters Haus oder bei ihrer andern Tochter.
Die Fenster standen weit offen, und die weißen Gardinen
bauschten sich im warmen, salzkräftigen Sommerwind. Ein starkes
Duften trug er von den Jasminbüschen bis in die Stube hinein, und
von Zeit zu Zeit summte eine Biene am Fenster vorbei.
Trina saß vor dem Tisch und räumte die Schublade auf, und der
Wind hatte ihr ein paar Haarsträhnen über die Stirn geweht. Ihre
Backen waren heiß, und sie glich wieder mehr Klein-Trina von früher.
Da klang ein leichter, fester Tritt vor dem Fenster. Karen trug ein
Bündel im Arm, und es war, als brächten die hellen Haare und die
hellen Augen noch mehr Licht in die Stube. Trina war so ganz bei der
Arbeit, daß sie das Lachen vergaß, und Karen konnte ungestört ihr
Bündel aufknoten.
Als sie ihr die Arbeit erklärt hatte, setzte sich Karen ans Fenster
und rief Klein-Klaus heran. Er spielte vor der Tür und kam langsam
Schritt vor Schritt näher, und seine prüfenden Augen ruhten ernst
auf der Fremden. Aber das helle Kleid, auf dem der breite
Sonnenschein lag, und die lachend klaren Augen gefielen ihm, und
er stellte sich zu ihr. Trina freute sich, daß er einmal artig war, und
sie sah schnell von ihrem Räumen auf.
Es war, als hätte der warme, sonnige Wind die Schwere zur Seite
geblasen, die sonst in dem Zimmer zu lasten schien. Es wurde Karen
heute fast leicht mit Trina zu reden.
Sie hatte eben eine Frage wegen Peters Kindern gestellt, da blieb
Trinas Blick auf einem Stück Papier haften, und sie gab ihr keine
Antwort mehr. Karen sah erstaunt auf Trina hin; aber sie starrte
immer auf den Brief. Und jetzt sah sie, wie sich Trinas Schultern
hoben, wie in unterdrücktem Schluchzen. Es ging wie eine Blässe
über ihr Gesicht und wie etwas Gequältes.
Da schob Karen den Jungen fort und zog ihren Stuhl zu Trina
hinüber. „Was ist es, Frau Asmussen, vielleicht kann ich helfen,“
sagte sie schnell und legte ihre Hand auf Trinas Arm.
Aber Trina rückte ängstlich zur Seite. „Nein, nein,“ sagte sie
hastig und deckte die Hand über das Papier. Aber große Tränen
waren in ihre Augen getreten, und sie sah Karen schnell ins Gesicht
wie mit einer quälenden Frage. Aber Karen scheute sich, weiter zu
drängen, und sah fast hilflos auf Trina.
Da legte die mit eins die Arme auf den Tisch und grub das
Gesicht in die Arme und ihr ganzer Körper bebte in heftigem Weinen.
Das ging Karen ins Herz, und sie legte den Arm um ihre Schulter.
„Ich kann’s gewiß hören, Trina,“ bat sie.
Trina weinte laut auf und, ohne den Kopf zu heben, schob sie ihr
das weiße Blatt hin. „Ist das wahr, o ist das wahr?“ schluchzte sie.
Auf dem Blatt stand ein kurzer ärztlicher Bericht über Trinas
Befinden und die Angabe der Zeit für ihre Rückkehr. Und darüber
gedruckt stand „Landesirrenanstalt“. — Nun wußte Trina, daß sie
nicht im Diakonissenhaus gewesen war. —
Karen strich ihr still über die Schultern. „Haben Sie’s gewußt?“
kam es endlich stoßweise zwischen dem Schluchzen hervor.
„Ja, Klein-Trina.“ Und Karen streichelte sie.
„Jetzt haben Sie Angst vor mir. — Und sie mögen mich alle nicht
mehr. — Und oh, ich schäme mich so.“ Und Trina wühlte den Kopf
noch tiefer, und das Schluchzen war herzbrechend. Da schmolz das
Harte in Karens Brust, das die Tür gegen Trina Asmussen gesperrt
hatte. Jetzt hatte sie vergessen, daß dies Lars’ Frau war. Es war nur
eben Klein-Trina, ein Menschenkind in großer Not. Und sie redete ihr
zu wie einem Kinde und tröstete sie, und daß die große, stolze Karen
noch so zu ihr sein konnte, das half Trina aus ihrer ersten Not über
die Schande, die auf ihr lag, heraus. —
Aber darum war sie doch noch da, wenn Karen ihr auch über dies
erste Erfahrene hinweggeholfen hatte. Und Trina schämte sich. —
Und am allermeisten schämte sie sich vor Lars. —
Aber von dem Tage an wußte Karen, daß sie getrost in die
Zukunft hineingehen konnte. Sie hatte Klein-Trina lieb gewonnen.
Kapitel XXVII
Lars Asmussen und Jakob Lind hatten recht. Es sitzt eine
heilende Kraft im Anpacken. Der Mensch treibt mit seiner frischen
Tat den Nebel vor sich her, daß er nicht mehr vor seinen Augen liegt
wie eine trübe Wand. Und während er noch mit aller Kraft bei
seinem Werke ist, hat sich leise, leise der Nebel geteilt, und der
erste keusche Sonnenstrahl tastet sich durch das trübe Grau. —
Dann kommt wohl irgendeine treue Hand und rührt ihn an und sagt:
„Da ist das Licht!“ Und er sieht auf und wagt fast noch nicht, sich zu
freuen. Dann aber hebt er den Kopf in den Sonnenschein und zieht
auf seiner eigenen Straße nach dem Ziel, das ihm in der großen
Ordnung gesteckt ist.
Und vielleicht ist es gar nicht fern.
Aber das gilt ihm gleich, denn er sieht wieder, daß es auf einem
hohen Berg gelegen ist und daß die Sonne scheint.
Der arme, kleine Mensch — nicht einmal den Nebel kann er
selbst vertreiben, um wieder seinen eigenen Weg in der großen
Ordnung zu sehen! Nur tapfer handeln kann er, seiner Art getreu,
und warten, bis der Nebel weicht. —
Lars war zu einem Entschlusse gekommen. Nicht, daß ihm Jakobs
Raten viel genützt hätte. — Guter Rat hat wohl noch keinen Mann
aus dem Brunnen gezogen. Und gerade einem aus dem
eigenwilligen nordischen Volke wäre es ein hartes Ringen gegen
seine Art gewesen, auf fremdes Wort zu hören. — Nein, der Rat tut’s
selten, aber die Liebe tut es. — Da ist es, als schlösse der andere
Mensch ein Fenster in seiner Seele auf. Mancher tut’s schnell, als
stieße er mit Kraft die beiden Flügel auf, der andere drückt und
stemmt und bringt die rostigen Angeln nur mühsam auseinander.
Aber wie es auch ist, und manchmal war es nur ein unbehilflich Wort
— aber von da innen aus der verschlossenen Seelentiefe sehen dann
so wunderlich strahlende Dinge hervor, die man nicht nennen kann
und nicht ausrechnend wägen. Aber für kurze Augenblicke hat sie
der in der großen Not gesehen, und ganz leise, wie von fern kommt
es ihm wie Lerchenglaube, daß da Licht sein könnte hinter dem
Nebel. —
Lars hatte eins verstanden: Da war ein Mensch, der glaubte noch
an ihn. Da wußte er, daß er wieder Mut fassen konnte, wenn er sich
aufraffte.
Und er schämte sich seiner Tatenlosigkeit. Er ging durch Haus
und Gartenland und sah, daß überall Arbeit wartete. Und wie er erst
anzupacken begann, begriff er nicht mehr, daß er es hatte so weit
kommen lassen. Es war zurückgegangen in Lars’ Wirtschaft. Und nun
faßte ihn die Arbeit wie ein Fieber. Peter wurde es fast zu viel, weil
Lars Stunde um Stunde draußen bei der Arbeit bleiben wollte. Und
wenn er dann vom Fischen kam, machte er sich an die Kartoffeln,
und Trina half ihm tüchtig beim Ausmachen. Und er besserte und
hämmerte überall. Und dann machte er sich mit dem Dachdecker
daran und setzte ein neues Strohdach auf Mutter Stinas Haus. Er
wurde mager in diesem Sommer über all dem harten Arbeiten; aber
als der Herbst herankam, war fast alles wieder so gut imstande in
den beiden Häusern und dem Gartenland wie sonst, und das viele
Arbeiten hatte auch Trina gut getan, und sie war so gesund und
ruhig, daß Mutter Lassen zu ihrer zweiten Tochter ziehen konnte, wo
eben wieder ein Kind geboren war.
In seinem Hause war es nun stiller und klarer geworden. Lars
war kaum zum Nachdenken gekommen. Er wußte nicht recht, wie
ihm selbst zumute war. Aber unbewußt war es auch klarer und
ruhiger in ihm, und da war auch allmählich ein Entschluß gereift. Er
wußte wohl, daß er die Unrast erst ganz los wurde, wenn er es sich
ganz unmöglich machte, Karen wiederzusehen. Das wollte er ihr nun
sagen. — Es mußte ein Abschluß gemacht sein.
Es war ein warmer Sonntagnachmittag für den beginnenden
Herbst. Lars ging nach Aalby. Als er in den Lehrergarten trat, sah er
gleich, daß Karen hinten unter dem Apfelbaum stand. Die schweren
Äste hatten viele Stützen, und doch bogen die rotbackigen Äpfel die
Zweige fast bis zum saftiglangen Grase hinunter. Zwei hellhaarige,
kleine Lehrerskinder standen neben Karen und hielten den großen
Korb. Den kleinen Zweijährigen hob sie nach den bunten Äpfeln
hinauf, und er patschte mit den dicken Armen in die vollen Äste
hinein und riß von den lustigen Früchten herunter. Karen nahm sie
ihm ab und warf sie in den Korb. Zwischen den Blättern aber lachten
die hellen Sonnenlichter hindurch und schillerten auf all den
hellhaarigen Köpfen und lagen wie goldene Flecke im schattig
bläulichen Grase. Es war wie ein Zittern in der Luft von hellen,
lachenden Kinderstimmen und warmen Sonnenlichtern.
Als Karen die Schritte hörte und sich umsah, ging es wie ein
ernster Schatten über die frohen Augen. — „Gleich,“ sagte sie,
„wenn ich hier fertig bin, will ich mit Ihnen sprechen.“ Dann setzte
sie das Kind zur Erde und zog ihm die kleine Schürze zurecht. Es
wollte weinen, aber sie gab ihm einen bunten Apfel zum Spielen und
faßte dann selbst in die roten Früchte hinein. Der Korb war bald
gefüllt, und sie schickte die Kinder damit ins Haus. Dann setzte sie
sich zu Lars auf die Bank unter dem Apfelbaum und hob den
Zweijährigen auf ihren Schoß. Lars aber sah immer unverwandt mit
dem ernsten Gesicht vor sich hin, so als merke er gar nichts von der
lachenden, reifenden Fülle ringsum, sondern sähn nur tief in sich
hinein auf einen steten, festen Punkt.
„Nun?“ fragte Karen endlich und sah auf das Kind hinunter.
„Ich habe mir das überlegt,“ sagte Lars, und er sprach es
eintönig, wie eingelernt, vor sich hin. „Es ist besser, ich komme nicht
mehr hierher. Ich wollte aber gern, daß Sie das wüßten. Und ich
wollte Ihnen auch gern Lebewohl sagen — für immer“ — setzte er
leiser hinzu.
Sie hob den Kopf und sah ihn fest an. — „Das habe ich schon
immer gedacht. Ich gehe auch zum ersten Januar nach Hamburg in
eine andere Stellung. Sie brauchten aber gar nicht erst zu kommen,
ich hätte das schon so gewußt, warum.“
„Vielleicht wollten Sie auch nichts mehr von mir wissen — jetzt!“
Es lag finster über seinem Gesicht und wie eine Bitte.
Es war einen Augenblick still. Ein Apfel fiel mit dumpfem Klang
ins Gras. Auf dem schmalen Fußsteig hüpfte eine Amsel mit ihren
Jungen und fütterte sie aus einem alten Apfel. Karen zeigte sie dem
Kinde, und es lachte und streckte die Arme nach den Vögeln. Da sah
sie Lars wieder fest in die Augen. „Ich wußte, daß es nicht so bleiben
würde, wie die Zeit im Winter. Ich wußte, daß Sie wieder zurecht
kommen würden, Lars Asmussen.“ Die Sonne lag ihr wieder in den
Augen.
„Warum wußten Sie das?“
„Das weiß ich nicht, aber ich weiß auch, daß alles wieder ganz
hell wird in Ihnen. Gott wird Sie noch brauchen, Lars Asmussen.“
Lars hatte die Ellbogen auf die Knie gestützt und sah tief ins
lange Gras hinunter. „Wenn man aber nichts merkt und nichts fühlt.“
— Er stockte.
„Sie fühlen es ja schon wieder, sonst wären Sie gar nicht so weit.
Sie haben nur geschlafen bis jetzt.“ Sie war ganz rot geworden,
solche Anstrengung war es ihr, so zu sprechen.
Er sah sie wieder an. „Vielleicht ist es so. — Es muß wohl etwas
sein“ — er sprach nicht fertig, sondern stand langsam auf. Sie stand
auch vor ihm. Das Kind hatte sie auf die Erde gleiten lassen, und es
trottete zu den kreischenden jungen Amseln hinüber. Einen
Augenblick ging es wie eine heiße Welle über sein Gesicht. Aber sie
sah ihm fest in die Augen und gab ihm die Hand. Da hielt er sie fest
in seiner schweren Arbeitsfaust, dann drehte er sich um und ging
hinaus, und sein Gesicht war so ruhig wie sonst.
Auf den Koppeln stand fast überall das Korn in Hocken. Es
knisterte förmlich in der warmen Sonne. Die Luft war sehr still. Hier
und da schnarrte der metallene Grillenklang zwischen den
glänzenden Stoppeln herauf. Lars stand und sah auf die strahlend
weißen Wolken, wie sie hinter den Koppeln riesenhaft
heraufwuchsen im tiefen Blau. Es war eine Stille in Lars Asmussen.
Er hatte vor den großen Rätseln gestanden und in die
unergründliche Nacht gesehen. Aber er hatte mit Taten auf das
Dunkel losgeschlagen. Und nun begann es, sachte, ganz sachte zu
tagen. Und in Lars’ Seele war es so, wie zu der feierlichen Stunde,
wenn der ernste Morgenwind vom kommenden Lichte raunt. Die
letzten Jahre hatten harte Linien in sein Gesicht gegraben. Aber er
ging wieder wie sonst fest und aufrecht seiner Arbeit zu.
Kapitel XXVIII
Christen Matthies war der erste, der im alten Vertrauen mit Lars
zu reden begann. Die andern beiden Männer behielten noch eine
Weile ihre verächtliche Art mit ihm. Aber er kehrte sich nicht an sie.
Er hatte ein paar große Aalkästen für die Räuchereien gezimmert
und ein gutes Stück Geld damit verdient. So konnte er sein Land
vergrößern. Auch brachte der Winterfang guten Verdienst. Was im
Haus oder an den Booten zu machen war, zimmerte er alles selbst,
so gab er weniger aus als die andern. Auch war Trina eine tüchtige
Frau und hielt das Geld gut zusammen. Er hielt sich viel für sich in
diesem Winter. Und Trina freute sich in ihrer stillen Art, daß er öfter
bei ihr saß. Wenn er in der Arbeit absetzte, dann gönnte er sich
wieder die alte Freude und saß hinter seinen Büchern. Er stützte
dann wohl einmal die Ellbogen auf den Tisch und sann vor sich hin.
Und ganz selten, wenn Trina fort war und Klaus in der Schule, holte
er auch das dicke Bibelbuch aus der Schublade und saß und blätterte
und sann. Und dann ging er wieder in seine Werkstatt im Schuppen
hinter dem Hause und hämmerte und zimmerte und machte sich
hier und da einen Nebenverdienst mit seinen geschickten Händen,
daß sie zum Frühling endlich wieder Geld nach der Sparkasse
bringen konnten.
In dem Sommer schaffte Lars nicht mehr so fieberhaft wie im
vorigen Jahr, aber er arbeitete mit ruhiger Stetigkeit.
Das ruhelose Sehnen, das in ihm gewesen war, hatte ihn nun
verlassen. Ganz tief unten im Grunde seines Herzens, dort, wo die
stillumfriedete Stelle war, dort wohnte auch seine Liebe. Aber ebenso
wie in seiner Knabenzeit, trat er dort selten ein. Wenn er einmal
ganz einsam sonntägliche Stille um sich fühlte, dann legte sich, wie
in alten Zeiten ein knabenhaft-ernster, fast finsterer Ausdruck über
das braune Arbeitergesicht, in dem jetzt so viele harte Linien
standen; dann war Lars in sein Heiligtum getreten. Aber es war
nichts Finsteres, was er dort in der Stille fand. Da war Karens helles
Bild, und da war Größeres als Karen.
Aber einen tiefen Ernst brachte er doch immer von dort ins Leben
zurück. In dem Ernst bekamen die Dinge um ihn her ein anderes
Gewicht und Maß. Der Hohn oder die Achtung der andern
kümmerten ihn nicht viel. Darum konnte er auch Peters und Kords
scharfe, harte Reden ruhig anhören, ohne ihnen, wie sonst, mit
bittern, zornigen Worten zu antworten. Seine fast gleichgültige
Schweigsamkeit machte sie stutzig, besonders da bei seiner Arbeit
nichts mehr von Gleichgültigkeit war. Da wurde ihnen die
verächtliche Art, die sie noch immer mit Lars hatten, zuerst
unbehaglich, und allmählich fielen sie unbewußt in ihren alten Ton
von den früheren Jahren zurück.
Die andern Männer, die mit ihnen zu tun hatten, empfanden die
größere Achtung in ihrer Art, mit Lars zu reden, und nahmen
denselben Ton an.
Mit einem lecken Boot oder einem kaputten Fischkasten fing es
an. Da durfte er wieder raten und helfen wie in alter Zeit. Und
allmählich waren es größere Dinge als Boote und Fischkasten,
wegen derer sie zu ihm kamen. Und ganz allmählich ließen sie es zu,
daß sich die Erinnerung an Lars’ böse Zeit verwischte.
Da merkte Lars, daß er sich doch noch freuen konnte. Und wie
das lange, klare Sommerlicht wieder über dem stillen Wasser lag, da
sah er mit festem, klarem Blick hinein. Und es war wie ein
Widerschein des hellen Sommerlichts in seinen Augen, und wie er
dastand, war es wie eine unerschütterliche Sicherheit über dem
ganzen Manne. Er sprach jetzt noch seltener als sonst, und er ging
auch seltener ins Wirtshaus. Aber gerade seine große
Schweigsamkeit gewann ihm das Vertrauen der Leute noch schneller
wieder.
Der Sommer war schon vorbei und der Heringsfang sollte wieder
beginnen. Da war es an einem Abend, an dem das Sägen und
Hämmern unten am Strande wieder in die große Stille hinausklang,
daß Kords zu Lars herangegangen kam. Seine Hände staken in den
Hosentaschen, und seine niedere Stirn sah noch finsterer aus als
sonst.
Lars sah nicht auf von der Arbeit. „Naa?“ fragte er, als sich Kords
neben ihn stellte.
„Naa,“ sagte Kords, „wer soll das Boot haben?“
„Hinrichsen,“ sagte Lars.
„So’n Ding kriegt leicht ein Leck,“ sagte Kords.
„Warum?“ brummte Lars und hämmerte dröhnend auf die
Planken.
„Naa, wenn man das rammt, so hier mit dem Vordersteven in die
Breitseite!“ Er fuhr mit der Hand an den Planken entlang und
wischte dann mit der knotigen, großen Faust durch sein Gesicht und
schnaufte dabei ein wenig verächtlich.
Lars tat noch ein paar Hammerschläge, dann richtete er sich auf
und sah Kords an. „Was ist eigentlich los?“ fragte er.
„Das habe ich gestern ausprobiert, was so’n Boot aushält, an
dem da von dem verfluchten Kerl!“
„Was für’n Kerl, nun erzähl’ vernünftig oder laß mich bei der
Arbeit!“
„Na, weißt du noch, von dem, der mich dazumal mit dem Stein
geschmissen hat?“
„Na, das ist wohl öfter bei dir vorgekommen!“
Kords stand da, groß und dunkel gegen die helle See, und als
stäken die überkräftigen, verarbeiteten Glieder überall zu groß aus
seinen Kleidern hervor. Es war nichts von Spaß an ihm, nur etwas
Mißmutiges, und eine ernste Wirklichkeit sah aus seinen
tiefliegenden, kleinen Augen heraus. Als Lars ihn ansah, stellte er
Hammer und Säge zur Seite und setzte sich auf den Bootrand.
„Naa?“ fragte er noch einmal ernster.
Fast zornig, als rede er wider seinen Willen, und ruckweise fing
Kords an:
„Du weißt doch, dazumal in der Stadt, als ich nicht streiten wollte
und mir der Kerl den Kopf halb einschmiß? Na, den Kerl kriegte ich
dazumal doch nicht zu packen. Aber denken konnte ich mir, wer’s
war. Da war so’n junger, bummliger Lump, der konnte mich nicht
leiden und soll nachher auch so ein paar Redensarten gemacht
haben, daß man ganz gut merken konnte, der war’s! Na, der
verfluchte Kerl ist nach Seegaade gezogen und fischt mit so ’nem
andern Kumpan da draußen. Laß ihn, hab’ ich mir gedacht, wenn ich
mir auch nichts Schöneres hätte denken können, als dem was
verwischen! Nu fängt das Untier aber an, wenn draußen zu tolle See
steht, und kommt hier in die Bucht. Ich das merken, und sobald
draußen Sturm steht, leg’ ich mich mit meinem Boot hin und laure.
Ich sage dir, Lars, auf hundert Meilen kenn’ ich das Boot! Wenn nun
der Kerl um die Landspitze kreuzt, und ich merke schon, da und
dahin geht der Kurs, dann lauf’ ich vor, werf’ Anker aus und fang’ an
zu fischen, und er kann abziehen und einen andern Platz suchen.
Und wenn ich dann merke, er hält Kurs auf einen guten Fischplatz,
laufe ich noch mal vor.“ Kords lachte rauh und schlug mit der Faust
aufs Knie. „Na, gestern war das denn auch so. Du weißt ja, jetzt im
Sommer habe ich doch meinen großen Jungen mit im Boot. — Wie
wir den fremden Kerl wieder reinlaufen sehen, gehen wir schnell
Anker hoch und laufen ihm vor. Zweimal machten wir das, da wird er
wild, kommt auf uns losgekreuzt, und wie er nah genug ist, fängt er
ganz elend an zu fluchen. Na so was kann ich nicht so gut vertragen
von so einem. — Du weißt ja, was das für ein Nordweststurm war
gestern. Der Junge reißt das Segel hoch, und ich lege das Ruder um,
so daß wir mit toller Fahrt losgehn, und eh’ der Kerl merkt, was ich
will, habe ich ihn Steuerbord gerammt. Ich sage dir, Lars, der und
sein Freund, die mußten schöpfen, daß sie trocken ans Land kamen,
und meinem Boot hat’s kaum was gemacht!“ Kords lachte wieder
fast roh heraus.
Aber Lars sah immer ganz gerade vor sich hin.
„Du mußt ihm Geld geben, daß er dich nicht verklagt,“ sagte er
nach einer Weile bedächtig.
„Das tu ich nicht, ich wollte, er wäre ganz ersoffen!“
„Dann wirst du wohl ins Gefängnis kommen, denn der andere
Mann kann ja bezeugen, daß du’s vorsätzlich tatest.“
Aber Kords stand finster da in der Dämmerung und sah nach der
andern Seite.
„Dann verklag’ ich ihn wegen Mordversuchs.“
„Aber du hast keine Zeugen.“
„Wer weiß, ob ich nicht doch noch jemand auftreibe, der ihn
durch den Hinterhof rennen sah.“
„Na,“ sagte Lars nachdenklich, „ich will’s denn mal versuchen,
wenn man ihm mit den alten Geschichten droht, vielleicht hält er
reinen Mund über diese Sache. Meinetwegen mag er mir sein
kaputtes Ding bringen. Ich werd’s flicken.“
„Schön Dank!“ sagte Kords.
Und am nächsten Sonnabend segelte Lars hinaus und brachte die
Sache in Ordnung.
Aber die Geschichte wurde doch unter den Fischern bekannt, und
an den nächsten Sonntagen im Wirtshaus sprachen sie leise darüber.
Und sie fluchten auf die Fischer von draußen, daß sie nun auch noch
anfingen, bei schlechtem Wetter an ihren Fischplätzen in der Bucht
zu fischen. Und alle freuten sich, daß Kords es dem von draußen
gegeben hatte. Über Lars aber nickten sie wohlgefällig mit dem Kopf,
weil er die Angelegenheit wieder zurechtgebracht hatte.
Da dauerte es nicht lange, daß er ihnen klar gemacht hatte, wie
not es tat, mit denen draußen zusammenzuhalten und feste Gesetze
über die Fischplätze und die Stellnetze zu machen. „Seht, wenn wir
an Tagen, wo für draußen allzuviel See steht, feste Plätze für sie hier
bei uns frei halten, werden die sich vielleicht drauf einlassen, die
Stellnetze nicht so weit vor die Bucht zu setzen.“
„Recht hast du wohl, Lars Asmussen,“ sagte Christen Matthies
langsam. „Aber wenn wir so eine Vereinigung gründen, kommt uns
da nicht die Regierung herein, und wir dürfen nicht mehr denken
und sagen, was wir wollen?“
Lars lachte still in sich herein. „Da sei ganz ruhig, Christen, du
kannst meinetwegen in deinem Herzen auf gammel Danmark
schwören. Wir wollen bloß zusammenhalten, damit jeder gerade sein
kann, wie er will, und uns keiner hereinredet.“
„Fein wäre das,“ schrie Kords auf einmal und haute mit der Faust
auf den Tisch. — Und die andern um den Tisch nickten ernsthaft mit
dem Kopf, und allmählich gingen sie alle darauf ein. Und da im
Tabaksdunst der Wirtsstube taten sich die ersten zusammen.
Zuhause mit Peter hatte Lars noch länger zu reden, eh’ er bereit
war, mitzumachen.
Dora hatte das Gute viel schneller gefaßt. „Warum denn n u r die
Fischer, Lars, die Arbeiter auf dem Lande brauchen auch so was. Laß
sie auch mitkommen, und dann können sie untereinander auch für
ihre eigenen Kranken und die Waisen sorgen.“
Da sah Lars sie ernst an. „Vielleicht kommt das mal so, Dora.“
Dora brachte auch Peter allmählich so weit, daß er nachgab. Es
dauerte nicht so sehr lange, da war die Vereinigung zustande
gekommen; denn sie sahen fast alle ein, daß es not tat.
Und als es ihnen Lars recht vorgestellt hatte, gingen sie immer
mehr mit dem Gedanken um, einen eigenen kleinen Dampfer zu
kaufen, der die Fische direkt zum Markt brächte. „Und dann gehört
noch dazu, daß wir einen Händler hätten, der zu unserm Verein
gehörte, damit die Fischpreise von uns aus bestimmt werden und die
Arbeit zu ihrem Rechte kommt,“ sagte Lars. Dazu schüttelten aber
viele die Köpfe und meinten, daß es sich nicht machen lassen werde.
— Und als das Jahr herum war, da hatte es sich gezeigt, daß die
neue Fischervereinigung gute Geschäfte machte. Die Fische kamen
frisch und gut mit dem Dampfer zur Stadt. — Und weil sie alle
zusammenhielten, konnten die Händler nicht viel gegen sie machen;
auch hörten sie, daß die Rede unter den Fischern ging, eigene
Händler anzustellen. Es war vorgekommen, daß einige von den
Fischern auch in der Schonzeit Heringe fischten, auch waren die
Maschen der Netze bei vielen unvorschriftsmäßig eng. Es war aber
sehr selten vorgekommen, daß der Fischmeister in dieser Bucht
nachgesehen hatte. Darum setzten sich die Fischer zusammen und
machten eigene Gesetze und schrieben ihre Anliegen nieder und
wählten unter sich sichere Männer und schickten die zur Stadt, damit
das Ganze von der Regierung bestätigt werde. Sie erreichten auch,
was sie wollten, und die Fischer waren zufrieden.
Der erste dieser sicheren Männer, den sie wählten, war Lars
Asmussen gewesen. Auch Peter Lassen war dabei und einige von
draußen. Und nun kam es ganz von selbst, daß sie anfingen, diese
Männer wie Führer anzusehn.
Als immer mehr Fischer der Vereinigung beitraten, da versuchten
einige Krakehler von Wanbyll, Macht über sie zu gewinnen. Aber sie
ließen sich nicht hereinreden und kamen nur überein, daß sie unter
sich Geld zurücklegen wollten für Notfälle. Und wieder war es Lars,
der alles deswegen ordnen mußte.
Kapitel XXIX
Lars hatte sich noch ein Stück niederes Uferland gekauft, auf
das bei Wind viel Seetang getrieben wurde. Wenn Lars nicht Zeit
hatte, dann stand Trina mit ihrem Jungen, und sie harkten das
Seegras herein, und sie trockneten es und hatten noch einen guten
Verdienst mit dem Verkauf.
Und Peter wußte, daß Lars immer mehr Geld auf die Sparkasse
brachte, und daß er es zu etwas gebracht hatte in den letzten zwei
Jahren. Auch sah er, wie sich die Leute von Lars führen ließen und
daß es doch Hand und Fuß hatte, was er riet. Da wachte auch die
alte Anhänglichkeit wieder auf, und er fing wieder an, zu Lars
aufzusehn. Und hinter Lars’ Rücken rühmte er ihn vor den Leuten
und machte ihnen klar, was Lars wolle, und kämpfte für seine Pläne.
Und Peter kamen die Worte leichter als Lars, daß er manch einen
gewann.
Sie erreichten es auch, daß der Fischdampfer nicht von
dänischem Gelde gekauft wurde. Das meiste hatten die Fischer
selbst bestritten, und es hatte viel Geld gekostet. Peter und Dora
hätten gern gewußt, wieviel Lars dazugegeben hatte, aber sie
bekamen es nicht heraus. Es mußte viel gewesen sein, meinten sie,
weil er wieder so hart an der Arbeit war.
„Das ist ja gar kein Leben,“ sagte Peter und stand mit den
Händen in den Hosentaschen dabei. „Man will doch einmal absetzen
und w i s s e n, daß man lebt.“
Aber Lars sah gar nicht auf, sondern hob den Ballen Seegras und
trug ihn fort. Dann kam er zurück. „Sieh, Peter, wenn du mir mal
hilfst, will ich hier einen Damm ziehen, damit mir die See nicht jedes
Jahr über dies Land spült; dann kann das mal eine gute Wiese
werden. Ein paar Kühe können wir uns dann vielleicht auch noch
kaufen.“ — Peter schüttelte den Kopf, aber er faßte an und half das
trockne Seegras hereinschaffen.
Peter aber konnte nicht wissen, wann Lars „lebte“. Wenn er sich
freute, dann schwieg er gerade so, wie wenn er litt.
Aber doch wußte Lars jetzt, daß er lebte.
* *
*
Es war ein warmer Frühlingsmorgen. Der Regen hatte alles
reingewaschen, nun kam der weiche, starke Wind vom Meer und
streichelte mit dem Sonnenschein um die Wette an den jungen,
feinen Blättern herum. Neben Lars’ Garten lief eine Quelle, die
murmelte und rauschte, als ließe sie sich keine Zeit, vor Lust
hineinzulaufen in den Sonnenschein und hinunter zu hasten nach
dem großen Wasser. Lars saß auf der kleinen Bank am Haus, und
sein Schatten fiel scharf und blau an die weiße Wand.
Trina trat aus der Tür. Es war Sonntag, und Lars hatte das gute,
blaue Zeug an. Trina strich ihm ein Stäubchen fort, und ihre Hand
nahm sich Zeit, wie eine Liebkosung. Lars sah in die weiche Bläue
hinein und hielt wohlgefällig still. Er streckte die langen Beine in die
Sonne, und ihm war wohl. Er konnte einmal aufatmen ohne Sorgen
und wissen, daß er an seinem rechten Platze stand. Darum war ihm
wie damals, als er ein Junge war. Er hätte sich wälzen mögen in dem
frischen, jungen Grün vor lauter drängendem Behagen.
Jakob Lind kam über die Höhe zwischen dem wogenden jungen
Korne daher. Er schlenderte gemächlich und hatte den Hut
abgenommen.
„Guten Morgen, Lars,“ sagte er und kam in den Garten. „Ich soll
zu Jes Land hinüber, der will meinen Rat haben wegen seines
Jungen. Er kann selbst nicht kommen mit dem kranken Bein.“
„Wer ist das denn?“
„Weißt du nicht, von dem sagen sie ja, wenn er in Wanbyll steht,
dann wirft die Nase noch Schatten bis Seegaade quer übers Wasser,
so lang ist sie.“
Lars lachte in sich hinein und nickte.
„Aber dich muß ich auch was fragen,“ sagte Jakob, „wegen Jung-
Klaus.“
„Na schieß los, Jakob! Ist der Jung ungezogen in der Schule?“
„Das ist es nicht. Ein Musterkind ist er ja gottlob nie gewesen.
Dazu hat er zu viel Leben im Blut. Aber der Jung ist klug. Du solltest
ihn was lernen lassen.“
Lars schwieg und sah wieder vor sich über das blaue Wasser in
die blaue Luft hinein. Er griff nach der Pfeife neben sich und steckte
sie bedächtig an. Langsam tat er ein paar tiefe Züge. Dann nahm er
sie heraus und rief: „Klaus!“
„Vater!“ antwortete es aus dem Hause.
„So, nun sag’s ihm, Jakob.“
Da fing Jakob Lind an und sprach bedächtig und freundlich, und
Klaus stand da, stämmig und groß in der blauen Wolljacke, ein
wenig breitbeinig, so, als wollte er recht festen Halt haben an der
Mutter Erde, und sah Jakob stramm in die Augen. Und Jakob setzte
es ihm auseinander, daß er bei den Büchern bleiben und etwas
Tüchtiges werden könne. „Vater könnte das wohl durchsetzen, wenn
du gern möchtest.“
„Was sollte es denn sein?“ fragte der Jung’.
„Na — vielleicht Schullehrer,“ sagte Jakob.
„Oha“, sagte der Jung’. Lars lachte. „Na, was möchtest du denn
werden, du Däskopf?“ fragte er.
„Ich möchte wohl werden wie du, Vater,“ sagte Klaus und sah in
fest an.
„Warum denn?“
Da steckte Klaus die Hände tief in die Hosentaschen und besann
sich. „Weißt du, Vaa, das Fischen mag ich wohl leiden, immer so da
draußen auf dem Wasser, und dann“ — er grub die Hände noch
tiefer, „dir hat keiner was zu sagen, du tust gerade, wie du willst, so
möchte ich auch sein.“
Da sahen sich Vater und Sohn noch einen Augenblick in die
Augen.
„Na, denn lauf wieder zu Mutter!“ sagte Lars. — Es dauerte gar
nicht lange, da kam von hinter dem Hause das trauliche Getön einer
Ziehharmonika durch die Frühlingsluft.
„Er hat die Musik von Großvater,“ sagte Lars wohlgefällig. „Aber
siehst du, Jakob, aus dem wird auch nichts weiter.“
Da nickte der. „Es mag wohl auch so am besten sein,“ sagte er
und stand auf.
„Ich meine es beinah auch,“ sagte Lars. —
Und dann saß Lars noch eine Weile. Klaus war weiter
fortgegangen mit seiner Ziehharmonika. Aus der Ferne kam das
Klingen, und es paßte sich zusammen mit dem Murmeln des Baches.
Und wie beides hineinschwamm in den Sonnenschein, war es wie
eine heimliche Traulichkeit und ein sinniges Behagen in der weichen
Frühlingsluft.
Ja dieser Zeit taute etwas auf in Lars’ Innerm. So etwas, was
noch immer wie in hartem Krampf in sich verschlossen gelegen
hatte. Bei all’ seiner Schweigsamkeit war doch etwas warmes
Menschliches an ihm zu spüren. Trina wagte es auch wohl einmal,
von Grund aus fröhlich zu sein, wenn der lange Lars in der Nähe war,
und es saß jetzt manchmal in seinen Augen wie bei Großvater, ganz
heimlich und versteckt, wie der Schalk. —
Sie lebten nicht mehr wie die Hamster oder Dachse, jeder nur für
seine saure Arbeit und jeder in seinem eigenen Bau, sondern sie
kamen alle zusammen, wenn sie Zeit hatten, und waren fast fröhlich
dabei.
Am häufigsten kamen Lars und Trina mit ihrem Jungen und Peter
mit seiner ganzen Familie Sonntags zu Mutter Stina herüber. Und
Mutter Stina bediente sie und saß mit ihrem traurig-ernsten Gesicht
zwischen ihnen, sagte selten ein Wort und war doch von Herzen
froh.
Oder sie packten ihre Boote bis oben voll mit ihren schreiend-
fröhlichen Kindern und fuhren mit ihnen über die Bucht, hinüber zu
Kords oder nach Aalby zu und gingen zu den Linds hinauf.
Aber all das waren Feiertage in ihrem Leben, denn in ihrer harten
Arbeit ließen sie nicht nach. Aber daß Lars überhaupt mit andern
Feiertage haben konnte, das war das Neue, was er nun endlich in
seinem Leben gelernt hatte.
Auch an Trinas Freuden und Wünsche dachte Lars jetzt
manchmal. Als ihr Geburtstag herankam, da hörte er gegen Abend
mit seinem harten Mühen auf und kam mit seinem Handwerkszeug
vom Strand herauf. In der einen Hand trug er vorsichtig einen
langen geräucherten Aal. Den brachte er ihr zum Geschenk. Der
sollte heute abend gegessen werden.
Und gegen Abend kamen sie alle im guten Zeug nach Lars’ Haus
heraufgegangen, Mutter Stina und Peter und Dora und die große
Tochter, die bald größer war als Jung-Klaus, und der älteste,
stämmige Sohn, der ganz so aussah wie Peter. Und das Jüngste, das
noch auf dem Arm getragen werden mußte, brachte Dora auch noch
mit. Und nachdem sie gegessen hatten, saßen sie alle herum in der
Dämmerung, und Klaus spielte ihnen ein Stück nach dem andern auf
seiner Ziehharmonika.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
ebookbell.com

Weitere ähnliche Inhalte

PDF
Programming Logic and Design Comprehensive 6th Edition Joyce Farrell
PDF
Programming: Principles and Practice Using C++ 2nd Edition, (Ebook PDF)
PDF
Test Bank for Starting out with Visual C#, 5th Edition, Tony Gaddis
PDF
(eBook PDF) Starting Out with Java: From Control Structures through Objects, ...
PDF
The Rust Programming Language Steve Klabnik
PDF
iOS 9 Programming Fundamentals with Swift Swift Xcode and Cocoa Basics 2nd Ed...
PDF
Solution Manual for C++ How to Program: Late Objects Version, 7/E 7th Edition...
PDF
Solution Manual for C How to Program, 7/E 7th Edition Paul Deitel, Harvey Deitel
Programming Logic and Design Comprehensive 6th Edition Joyce Farrell
Programming: Principles and Practice Using C++ 2nd Edition, (Ebook PDF)
Test Bank for Starting out with Visual C#, 5th Edition, Tony Gaddis
(eBook PDF) Starting Out with Java: From Control Structures through Objects, ...
The Rust Programming Language Steve Klabnik
iOS 9 Programming Fundamentals with Swift Swift Xcode and Cocoa Basics 2nd Ed...
Solution Manual for C++ How to Program: Late Objects Version, 7/E 7th Edition...
Solution Manual for C How to Program, 7/E 7th Edition Paul Deitel, Harvey Deitel

Ähnlich wie Structure And Interpretation Of Computer Programs 2e Javascript Edition 2nd Edition Harold Abelson (14)

PDF
Solution Manual for C How to Program, 7/E 7th Edition Paul Deitel, Harvey Deitel
PDF
A comprehensive introduction to object oriented programming with Java 1st Edi...
PDF
Technology In Action Complete 12th Edition Evans Test Bank
PDF
Coding Python Raspberry Pi Larry Lutz Richard Ray
PDF
Download full ebook of Notes of C language Anjana Chaudhary instant download pdf
PDF
Introducing Python Modern Computing in Simple Packages 1st Edition Bill Luban...
PDF
The Computer from Pascal to von Neumann Herman H. Goldstine
PDF
Theory Of Automata Formal Languages And Computation Sp Eugene Xavier
PDF
Begin to Code with JavaScript 1st Edition Miles
PDF
Java in a Nutshell A Desktop Quick Reference 7th Edition Benjamin J. Evans
PDF
Go In Action Second Edition Meap V03 2 Chapters 1 To 4 Of 11 Andrew Walker
PDF
Java Software Solutions 8th Edition Lewis Test Bank
PPTX
0b101000 years of computing: a personal timeline - decade "0", the 1980's
PDF
Logical Foundations Of Computer Science International Symposium Lfcs 2016 Dee...
Solution Manual for C How to Program, 7/E 7th Edition Paul Deitel, Harvey Deitel
A comprehensive introduction to object oriented programming with Java 1st Edi...
Technology In Action Complete 12th Edition Evans Test Bank
Coding Python Raspberry Pi Larry Lutz Richard Ray
Download full ebook of Notes of C language Anjana Chaudhary instant download pdf
Introducing Python Modern Computing in Simple Packages 1st Edition Bill Luban...
The Computer from Pascal to von Neumann Herman H. Goldstine
Theory Of Automata Formal Languages And Computation Sp Eugene Xavier
Begin to Code with JavaScript 1st Edition Miles
Java in a Nutshell A Desktop Quick Reference 7th Edition Benjamin J. Evans
Go In Action Second Edition Meap V03 2 Chapters 1 To 4 Of 11 Andrew Walker
Java Software Solutions 8th Edition Lewis Test Bank
0b101000 years of computing: a personal timeline - decade "0", the 1980's
Logical Foundations Of Computer Science International Symposium Lfcs 2016 Dee...
Anzeige

Structure And Interpretation Of Computer Programs 2e Javascript Edition 2nd Edition Harold Abelson

  • 1. Structure And Interpretation Of Computer Programs 2e Javascript Edition 2nd Edition Harold Abelson download https://ebookbell.com/product/structure-and-interpretation-of- computer-programs-2e-javascript-edition-2nd-edition-harold- abelson-49972362 Explore and download more ebooks at ebookbell.com
  • 2. Here are some recommended products that we believe you will be interested in. You can click the link to download. Structure And Interpretation Of Computer Programs Second Edition 2nd Edition Hal Abelson And Gerald Jay Sussman https://ebookbell.com/product/structure-and-interpretation-of- computer-programs-second-edition-2nd-edition-hal-abelson-and-gerald- jay-sussman-5849384 Structure And Interpretation Of Computer Programs Javascript Adaptation 2nd Harold Abelson And Gerald Jay Sussman With Julie Sussman Adapted By Martin Henz And Tobias Wrigstad https://ebookbell.com/product/structure-and-interpretation-of- computer-programs-javascript-adaptation-2nd-harold-abelson-and-gerald- jay-sussman-with-julie-sussman-adapted-by-martin-henz-and-tobias- wrigstad-23009056 Structure And Interpretation Of Computer Programs Javascript Edition Harold Abelson Gerald Sussman Martin Henz Tobias Wrigstad https://ebookbell.com/product/structure-and-interpretation-of- computer-programs-javascript-edition-harold-abelson-gerald-sussman- martin-henz-tobias-wrigstad-62620506 6001 Structure And Interpretation Of Computer Programs Copyright https://ebookbell.com/product/6001-structure-and-interpretation-of- computer-programs-copyright-2463106
  • 3. Structure And Interpretation Of Signals And Systems 1st Edward A Lee https://ebookbell.com/product/structure-and-interpretation-of-signals- and-systems-1st-edward-a-lee-4573552 Structure And Interpretation Of Classical Mechanics 2nd Edition Gerald Jay Sussman https://ebookbell.com/product/structure-and-interpretation-of- classical-mechanics-2nd-edition-gerald-jay-sussman-7354242 Structure And Interpretation Of Classical Mechanics Gerald Jay Sussman https://ebookbell.com/product/structure-and-interpretation-of- classical-mechanics-gerald-jay-sussman-931284 Structure And Interpretation Of Signals And Systems Edward A Lee https://ebookbell.com/product/structure-and-interpretation-of-signals- and-systems-edward-a-lee-1305958 Structure And Interpretation Of Classical Mechanics G Sussman https://ebookbell.com/product/structure-and-interpretation-of- classical-mechanics-g-sussman-4094762
  • 5. Structure and Interpretation of Computer Programs JavaScript Edition
  • 7. Structure and Interpretation of Computer Programs JavaScript Edition Harold Abelson and Gerald Jay Sussman adapted to JavaScript by Martin Henz and Tobias Wrigstad with Julie Sussman The MIT Press Cambridge, Massachusetts London, England
  • 8. © 2022 Massachusetts Institute of Technology This book is published by The MIT Press under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA). To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/. The text of this book is derived from the book Structure and Interpretation of Computer Programs, Second Edition, 1996, (SICP) and is subject to a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA). A comparison edition available at http://sicp.sourceacademy.org indicates the changes that were made to the text. The figures are derived from figures created by Andres Raba in 2015 and are also subject to CC BY-SA. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/. The JavaScript programs in this book are derived from the Scheme programs in SICP and are subject to the GNU General Public License v3.0. To view a copy of this license, visit https://www.gnu.org/licenses/gpl-3.0.html. The original image of MIT founder William Barton Rogers in section 2.2.4 is courtesy MIT Museum. The cover image is adapted from Le Moyen Age et la Renaissance, Paris, 1848–1851. This book was set in Times by the authors using the L A TEX typesetting system and ancillary scripts (see https://github.com/source-academy/sicp), and was printed and bound in the United States of America. Library of Congress Cataloging-in-Publication Data Names: Abelson, Harold, author. | Sussman, Gerald Jay, author. | Henz, Martin, adapter. | Wrigstad, Tobias, adapter. | Sussman, Julie, other. Title: Structure and interpretation of computer programs / Harold Abelson and Gerald Jay Sussman; adapted to JavaScript by Martin Henz and Tobias Wrigstad; with Julie Sussman. Description: Javascript edition. | Cambridge : The MIT Press, [2022] | Series: MIT electrical engineering and computer science series | Includes bibliographical references and index. Identifiers: LCCN 2021047249 | ISBN 9780262543231 (paperback) Subjects: LCSH: Computer programming. | JavaScript (Computer program language) Classification: LCC QA76.6 .A255 2022 | DDC 005.13–dc23 LC record available at https://lccn.loc.gov/2021047249 10 9 8 7 6 5 4 3 2 1
  • 9. This book is dedicated, in respect and admiration, to the spirit that lives in the computer.
  • 11. “I think it’s extraordinarily important that we in computer science keep fun in computing. When it started out, it was an awful lot of fun. Of course, the paying customers got shafted every now and then, and after a while we began to take their complaints seriously. We began to feel as though we really were responsible for the successful, error-free, perfect use of these machines. I don’t think we are. I think we’re responsible for stretching them, setting them off in new directions, and keeping fun in the house. Fun comes in many ways. Fun comes in making a discovery, proving a theorem, writing a program, breaking a code. Whatever form or sense it comes in I hope the field of computer science never loses its sense of fun. Above all, I hope we don’t become missionaries. What you know about computing other people will learn. Don’t feel as though the key to successful computing is only in your hands. What’s in your hands, I think and hope, is intelligence: the ability to see the machine as more than when you were first led up to it, that you can make it more.” —Alan J. Perlis (April 1, 1922–February 7, 1990)
  • 13. Contents Foreword xiii Foreword to Structure and Interpretation of Computer Programs, 1984 xvii Preface xxi Prefaces to Structure and Interpretation of Computer Programs, 1996 & 1984 xxiii Acknowledgments xxvii 1 Building Abstractions with Functions 1 1.1 The Elements of Programming 3 1.1.1 Expressions 3 1.1.2 Naming and the Environment 5 1.1.3 Evaluating Operator Combinations 6 1.1.4 Compound Functions 8 1.1.5 The Substitution Model for Function Application 11 1.1.6 Conditional Expressions and Predicates 13 1.1.7 Example: Square Roots by Newton’s Method 18 1.1.8 Functions as Black-Box Abstractions 21 1.2 Functions and the Processes They Generate 26 1.2.1 Linear Recursion and Iteration 27 1.2.2 Tree Recursion 32 1.2.3 Orders of Growth 36 1.2.4 Exponentiation 38 1.2.5 Greatest Common Divisors 41 1.2.6 Example: Testing for Primality 43 1.3 Formulating Abstractions with Higher-Order Functions 48 1.3.1 Functions as Arguments 49 1.3.2 Constructing Functions using Lambda Expressions 53 1.3.3 Functions as General Methods 58 1.3.4 Functions as Returned Values 63 2 Building Abstractions with Data 69 2.1 Introduction to Data Abstraction 72 2.1.1 Example: Arithmetic Operations for Rational Numbers 72 2.1.2 Abstraction Barriers 76 2.1.3 What Is Meant by Data? 78 2.1.4 Extended Exercise: Interval Arithmetic 81
  • 14. x Contents 2.2 Hierarchical Data and the Closure Property 84 2.2.1 Representing Sequences 85 2.2.2 Hierarchical Structures 93 2.2.3 Sequences as Conventional Interfaces 98 2.2.4 Example: A Picture Language 110 2.3 Symbolic Data 124 2.3.1 Strings 124 2.3.2 Example: Symbolic Differentiation 126 2.3.3 Example: Representing Sets 131 2.3.4 Example: Huffman Encoding Trees 140 2.4 Multiple Representations for Abstract Data 148 2.4.1 Representations for Complex Numbers 150 2.4.2 Tagged data 153 2.4.3 Data-Directed Programming and Additivity 157 2.5 Systems with Generic Operations 164 2.5.1 Generic Arithmetic Operations 165 2.5.2 Combining Data of Different Types 170 2.5.3 Example: Symbolic Algebra 177 3 Modularity, Objects, and State 191 3.1 Assignment and Local State 192 3.1.1 Local State Variables 192 3.1.2 The Benefits of Introducing Assignment 199 3.1.3 The Costs of Introducing Assignment 202 3.2 The Environment Model of Evaluation 208 3.2.1 The Rules for Evaluation 209 3.2.2 Applying Simple Functions 212 3.2.3 Frames as the Repository of Local State 215 3.2.4 Internal Declarations 220 3.3 Modeling with Mutable Data 224 3.3.1 Mutable List Structure 224 3.3.2 Representing Queues 233 3.3.3 Representing Tables 237 3.3.4 A Simulator for Digital Circuits 243 3.3.5 Propagation of Constraints 254 3.4 Concurrency: Time Is of the Essence 265 3.4.1 The Nature of Time in Concurrent Systems 266 3.4.2 Mechanisms for Controlling Concurrency 270 3.5 Streams 282 3.5.1 Streams Are Delayed Lists 283 3.5.2 Infinite Streams 290 3.5.3 Exploiting the Stream Paradigm 297 3.5.4 Streams and Delayed Evaluation 307 3.5.5 Modularity of Functional Programs and Modularity of Objects 313
  • 15. Contents xi 4 Metalinguistic Abstraction 319 4.1 The Metacircular Evaluator 321 4.1.1 The Core of the Evaluator 323 4.1.2 Representing Components 330 4.1.3 Evaluator Data Structures 341 4.1.4 Running the Evaluator as a Program 346 4.1.5 Data as Programs 350 4.1.6 Internal Declarations 353 4.1.7 Separating Syntactic Analysis from Execution 357 4.2 Lazy Evaluation 362 4.2.1 Normal Order and Applicative Order 363 4.2.2 An Interpreter with Lazy Evaluation 364 4.2.3 Streams as Lazy Lists 372 4.3 Nondeterministic Computing 375 4.3.1 Search and amb 376 4.3.2 Examples of Nondeterministic Programs 380 4.3.3 Implementing the amb Evaluator 388 4.4 Logic Programming 400 4.4.1 Deductive Information Retrieval 403 4.4.2 How the Query System Works 413 4.4.3 Is Logic Programming Mathematical Logic? 421 4.4.4 Implementing the Query System 426 5 Computing with Register Machines 451 5.1 Designing Register Machines 452 5.1.1 A Language for Describing Register Machines 454 5.1.2 Abstraction in Machine Design 458 5.1.3 Subroutines 459 5.1.4 Using a Stack to Implement Recursion 464 5.1.5 Instruction Summary 470 5.2 A Register-Machine Simulator 470 5.2.1 The Machine Model 472 5.2.2 The Assembler 476 5.2.3 Instructions and Their Execution Functions 479 5.2.4 Monitoring Machine Performance 486 5.3 Storage Allocation and Garbage Collection 489 5.3.1 Memory as Vectors 490 5.3.2 Maintaining the Illusion of Infinite Memory 495 5.4 The Explicit-Control Evaluator 501 5.4.1 The Dispatcher and Basic Evaluation 502 5.4.2 Evaluating Function Applications 506 5.4.3 Blocks, Assignments, and Declarations 514 5.4.4 Running the Evaluator 515
  • 16. xii Contents 5.5 Compilation 521 5.5.1 Structure of the Compiler 524 5.5.2 Compiling Components 529 5.5.3 Compiling Applications and Return Statements 537 5.5.4 Combining Instruction Sequences 545 5.5.5 An Example of Compiled Code 548 5.5.6 Lexical Addressing 556 5.5.7 Interfacing Compiled Code to the Evaluator 559 References 567 Index 573 List of Exercises 609
  • 17. Foreword I had the pleasure of meeting the amazing Alan Perlis and talking with him a few times, when I was still a student. He and I had in common a deep love and respect for two very different programming languages: Lisp and APL. Following in his footsteps is a daunting task, even though he blazed an excellent trail. Still, I would like to reexamine one comment he made in the original foreword to this book (and, please, I suggest that you read his foreword, which immediately follows this one, before you finish this one). Is it really true that it is better to have 100 functions operate on one data structure than to have 10 functions operate on 10 data structures? To answer that question carefully, we first need to ask whether that one data struc- ture is “universal”: can it conveniently fulfill the roles of those 10 more specialized data structures? For that matter, we can also ask: do we really need 100 functions? Is there a single universal function that can fulfill the roles of all those other functions? The surprising answer to that last question is “yes”; it is only slightly tricky to construct a function that accepts (1) a data structure that serves as a description of some other function, and (2) a list of arguments, and behaves exactly as that other function would when applied to the given arguments. And it is only slightly tricky to design a data structure capable of describing any computation whatsoever. One such data structure (the tagged-list representation of expressions and statements, paired with environments that associate names with values) and one such universal function (apply) are described in Chapter 4 of this book. So maybe we need only one function and one data structure. That is true in theory. In practice, we find it convenient to draw distinctions that help us, as human beings constructing descriptions of computations, to organize the structure of our code so that we can better understand them. I believe that Perlis was making a remark not about computational capability, but about human abilities and human limitations. One thing the human mind seems to do well is to name things; we have powerful associative memories. Given a name, we can quickly recall some associated thing to mind. This is why we typically find it easier to work with the lambda calculus than the combinatory calculus; it is much easier for most people to interpret the Lisp expression (lambda (x) (lambda (y) (+ x y))) or the JavaScript expression x => y => x + y than the combinatory expression ((S ((S (K S)) ((S ((S (K S)) ((S (K K)) (K +)))) ((S (K K)) I)))) (K I)) even though there is a direct structural correspondence, easily expressed in five lines of Lisp code. So while in principle we could get by with just one universal function, we pre- fer to modularize our code, to give names to the various pieces, and to mention the names of function descriptions rather than constantly feeding the descriptions themselves to the universal function.
  • 18. xiv Foreword In my 1998 talk “Growing a Language,” I commented that a good programmer “does not just write programs. A good programmer builds a working vocabulary.” As we design and define more and more parts of our programs, we give names to those parts, and the result is that we have a richer language in which to write the rest. But we also find it natural to draw distinctions among data structures, and to give them names. It may be that nested lists are a universal data structure (and it is worth noting that many modern and widely used data structures, such as HTML and XML and JSON, are also parenthetically nested representations, only slightly more elaborate than Lisp’s bare parentheses). There are also many functions, such as finding the length of a list or applying a function to every element of a list and getting back a list of the results, that are useful in a wide variety of situations. And yet, when I am thinking about a specific computation, I often say to myself, “This list of two things I expect to be a personal name and a surname, but that list of two things I expect to be the real and imaginary parts of a complex number, and that other list of two things I will regard as the numerator and denominator of a fraction.” In other words, I draw distinctions—and it may be useful to represent those distinctions explicitly in the data structure, in part to prevent mistakes such as accidentally treating a complex number as a fraction. (Again, this is a comment about human abilities and human limitations.) Since the first edition of this book was written, almost four decades ago, a lot more ways of organizing data have become relatively standard, in particular the “object-oriented” approach, and many languages, including JavaScript, support spe- cialized data structures such as objects and strings and heaps and maps with a variety of built-in mechanisms and libraries. But in doing so, many languages abandoned support for more general, universal notions. Java, for example, originally did not sup- port first-class functions, and has incorporated them only relatively recently, greatly increasing its expressive power. APL, likewise, originally did not support first-class functions, and moreover its original single data structure—arrays of any number of dimensions—was not so conveniently useful as a universal data structure because arrays could not contain other arrays as elements. More recent versions of APL do support anonymous function values and nested arrays, and these have made APL dramatically more expressive. (The original design of APL did have two very good things going for it: a comprehensive set of functions applicable to that one data structure, and moreover an extremely well chosen set of names for those functions. I’m not talking about the funny symbols and Greek letters, but the spoken words that APL programmers use when mentioning them, words like shape, reshape, compress, expand, and laminate; these are names not for the symbols, but for the functions they repre- sent. Ken Iverson had a real knack for choosing short, memorable, vivid names for functions on arrays.) While JavaScript, like Java, was originally designed with objects and methods in mind, it also incorporated first-class functions from the beginning, and it is not difficult to use its objects to define a universal data structure. As a result, JavaScript
  • 19. Foreword xv is not as distant from Lisp as you would think, and as this edition of Structure and Interpretation of Computer Programs demonstrates, it is a good alternate framework for presenting the key ideas. SICP was never about a programming language; it presents powerful, general ideas for program organization that ought to be useful in any language. What do Lisp and JavaScript have in common? The ability to abstract a compu- tation (code plus some associated data) for later execution as a function; the ability to embed references to such functions within data structures; the ability to invoke functions on arguments; the ability to draw a distinction (conditional execution); a convenient universal data structure; completely automatic storage management for that data (which seems like a no-brainer, given everything else, until you realize that many widely used programming languages don’t have it); a large set of useful functions for operating on that universal data structure; and standard strategies for using the universal data structure to represent more specialized data structures. So maybe the truth is somewhere in between the extremes that Perlis so elo- quently posited. Maybe the sweet spot is something more like 40 functions general enough to operate usefully on a universal data structure such as lists, but also 10 sets of 6 functions each that are relevant when we take one of 10 specialized views of that universal data structure. This is manageable if we give good names to these functions and specialized views. As you read this book, please pay attention not only to the programming lan- guage constructs and how they are used, but also to the names given to functions and variables and data structures. They are not all as short and vivid as the names Iverson chose for his APL functions, but they have been chosen in a deliberate and systematic way to enhance your understanding of the overall program structure. Primitives, means of combination, functional abstraction, naming, and conven- tions for using a universal data structure in specialized ways by drawing distinctions: these are the fundamental building blocks of a good programming language. From there, imagination and good engineering judgment based on experience can do the rest. —Guy L. Steele Jr., Lexington, Massachusetts, 2021
  • 21. Foreword to Structure and Interpretation of Computer Programs, 1984 Educators, generals, dieticians, psychologists, and parents program. Armies, stu- dents, and some societies are programmed. An assault on large problems employs a succession of programs, most of which spring into existence en route. These pro- grams are rife with issues that appear to be particular to the problem at hand. To appreciate programming as an intellectual activity in its own right you must turn to computer programming; you must read and write computer programs—many of them. It doesn’t matter much what the programs are about or what applications they serve. What does matter is how well they perform and how smoothly they fit with other programs in the creation of still greater programs. The programmer must seek both perfection of part and adequacy of collection. In this book the use of “program” is focused on the creation, execution, and study of programs written in a dialect of Lisp for execution on a digital computer. Using Lisp we restrict or limit not what we may program, but only the notation for our program descriptions. Our traffic with the subject matter of this book involves us with three foci of phenomena: the human mind, collections of computer programs, and the computer. Every computer program is a model, hatched in the mind, of a real or mental process. These processes, arising from human experience and thought, are huge in number, intricate in detail, and at any time only partially understood. They are modeled to our permanent satisfaction rarely by our computer programs. Thus even though our programs are carefully handcrafted discrete collections of symbols, mosaics of in- terlocking functions, they continually evolve: we change them as our perception of the model deepens, enlarges, generalizes until the model ultimately attains a metastable place within still another model with which we struggle. The source of the exhilaration associated with computer programming is the continual unfolding within the mind and on the computer of mechanisms expressed as programs and the explosion of perception they generate. If art interprets our dreams, the computer executes them in the guise of programs! For all its power, the computer is a harsh taskmaster. Its programs must be cor- rect, and what we wish to say must be said accurately in every detail. As in every other symbolic activity, we become convinced of program truth through argument. Lisp itself can be assigned a semantics (another model, by the way), and if a pro- gram’s function can be specified, say, in the predicate calculus, the proof methods of logic can be used to make an acceptable correctness argument. Unfortunately, as programs get large and complicated, as they almost always do, the adequacy, con- sistency, and correctness of the specifications themselves become open to doubt, so that complete formal arguments of correctness seldom accompany large programs. Since large programs grow from small ones, it is crucial that we develop an arsenal of standard program structures of whose correctness we have become sure—we call them idioms—and learn to combine them into larger structures using organizational techniques of proven value. These techniques are treated at length in this book, and understanding them is essential to participation in the Promethean enterprise called
  • 22. xviii Foreword to SICP, 1984 programming. More than anything else, the uncovering and mastery of powerful or- ganizational techniques accelerates our ability to create large, significant programs. Conversely, since writing large programs is very taxing, we are stimulated to invent new methods of reducing the mass of function and detail to be fitted into large programs. Unlike programs, computers must obey the laws of physics. If they wish to per- form rapidly—a few nanoseconds per state change—they must transmit electrons only small distances (at most 11 2 feet). The heat generated by the huge number of devices so concentrated in space has to be removed. An exquisite engineering art has been developed balancing between multiplicity of function and density of devices. In any event, hardware always operates at a level more primitive than that at which we care to program. The processes that transform our Lisp programs to “machine” programs are themselves abstract models which we program. Their study and cre- ation give a great deal of insight into the organizational programs associated with programming arbitrary models. Of course the computer itself can be so modeled. Think of it: the behavior of the smallest physical switching element is modeled by quantum mechanics described by differential equations whose detailed behavior is captured by numerical approximations represented in computer programs executing on computers composed of ...! It is not merely a matter of tactical convenience to separately identify the three foci. Even though, as they say, it’s all in the head, this logical separation induces an acceleration of symbolic traffic between these foci whose richness, vitality, and potential is exceeded in human experience only by the evolution of life itself. At best, relationships between the foci are metastable. The computers are never large enough or fast enough. Each breakthrough in hardware technology leads to more massive programming enterprises, new organizational principles, and an enrichment of abstract models. Every reader should ask himself periodically “Toward what end, toward what end?”—but do not ask it too often lest you pass up the fun of programming for the constipation of bittersweet philosophy. Among the programs we write, some (but never enough) perform a precise math- ematical function such as sorting or finding the maximum of a sequence of numbers, determining primality, or finding the square root. We call such programs algorithms, and a great deal is known of their optimal behavior, particularly with respect to the two important parameters of execution time and data storage requirements. A pro- grammer should acquire good algorithms and idioms. Even though some programs resist precise specifications, it is the responsibility of the programmer to estimate, and always to attempt to improve, their performance. Lisp is a survivor, having been in use for about a quarter of a century. Among the active programming languages only Fortran has had a longer life. Both languages have supported the programming needs of important areas of application, Fortran for scientific and engineering computation and Lisp for artificial intelligence. These two areas continue to be important, and their programmers are so devoted to these two languages that Lisp and Fortran may well continue in active use for at least another quarter-century. Lisp changes. The Scheme dialect used in this text has evolved from the original Lisp and differs from the latter in several important ways, including static scoping for variable binding and permitting functions to yield functions as values. In its
  • 23. Foreword to SICP, 1984 xix semantic structure Scheme is as closely akin to Algol 60 as to early Lisps. Algol 60, never to be an active language again, lives on in the genes of Scheme and Pascal. It would be difficult to find two languages that are the communicating coin of two more different cultures than those gathered around these two languages. Pascal is for building pyramids—imposing, breathtaking, static structures built by armies pushing heavy blocks into place. Lisp is for building organisms—imposing, breath- taking, dynamic structures built by squads fitting fluctuating myriads of simpler organisms into place. The organizing principles used are the same in both cases, except for one extraordinarily important difference: The discretionary exportable functionality entrusted to the individual Lisp programmer is more than an order of magnitude greater than that to be found within Pascal enterprises. Lisp programs inflate libraries with functions whose utility transcends the application that produced them. The list, Lisp’s native data structure, is largely responsible for such growth of utility. The simple structure and natural applicability of lists are reflected in func- tions that are amazingly nonidiosyncratic. In Pascal the plethora of declarable data structures induces a specialization within functions that inhibits and penalizes casual cooperation. It is better to have 100 functions operate on one data structure than to have 10 functions operate on 10 data structures. As a result the pyramid must stand unchanged for a millennium; the organism must evolve or perish. To illustrate this difference, compare the treatment of material and exercises within this book with that in any first-course text using Pascal. Do not labor under the illusion that this is a text digestible at MIT only, peculiar to the breed found there. It is precisely what a serious book on programming Lisp must be, no matter who the student is or where it is used. Note that this is a text about programming, unlike most Lisp books, which are used as a preparation for work in artificial intelligence. After all, the critical program- ming concerns of software engineering and artificial intelligence tend to coalesce as the systems under investigation become larger. This explains why there is such growing interest in Lisp outside of artificial intelligence. As one would expect from its goals, artificial intelligence research generates many significant programming problems. In other programming cultures this spate of problems spawns new languages. Indeed, in any very large programming task a useful organizing principle is to control and isolate traffic within the task modules via the invention of language. These languages tend to become less primitive as one approaches the boundaries of the system where we humans interact most often. As a result, such systems contain complex language-processing functions replicated many times. Lisp has such a simple syntax and semantics that parsing can be treated as an elementary task. Thus parsing technology plays almost no role in Lisp pro- grams, and the construction of language processors is rarely an impediment to the rate of growth and change of large Lisp systems. Finally, it is this very simplicity of syntax and semantics that is responsible for the burden and freedom borne by all Lisp programmers. No Lisp program of any size beyond a few lines can be written without being saturated with discretionary functions. Invent and fit; have fits and reinvent! We toast the Lisp programmer who pens his thoughts within nests of parentheses. —Alan J. Perlis, New Haven, Connecticut
  • 25. Preface The book Structure and Interpretation of Computer Programs (SICP) introduces the reader to central ideas of computation by establishing a series of mental models for computation. Chapters 1–3 cover programming concepts that are common to all modern high-level programming languages. The original first two editions of SICP use the programming language Scheme in their program examples, whose minimalist, expression-oriented syntax allows the book to focus on the underlying ideas rather than the design of the chosen language. Chapters 4 and 5 use Scheme to formulate language processors for Scheme, deepening the readers’ understanding of the mental models and exploring language extensions and alternatives. Since its publication in 1984 and its second edition in 1996, SICP has been adopted as a textbook by universities and colleges around the world, including the National University of Singapore (NUS), which introduced the SICP-based introduc- tory course CS1101S in 1997. In the mid-1990s, the languages Python, JavaScript, and Ruby emerged, which share central design elements with Scheme, but which em- ploy a more complex, statement-oriented syntax that uses familiar algebraic (infix) notation. Their rise in popularity led instructors to adapt their SICP-based courses, typically by translating the example programs to their language of choice, by adding material specific to that language, and by omitting the material of chapters 4 and 5. Adapting SICP to JavaScript The work on adapting the second edition of SICP to JavaScript (SICP JS) started at NUS in 2008, and CS1101S switched to JavaScript in 2012. The language standard ECMAScript 2015 introduced lambda expressions, tail recursion, and block-scoped variables and constants, which enabled the adaptation to become quite close to the original. We made substantial changes to SICP only when we felt they were forced by differences between JavaScript and Scheme. The book covers just a small frac- tion of JavaScript, so a reader would be ill-advised to use it to learn the language. For example, the notion of a JavaScript object—considered one of its fundamental ingredients by any measure—is not even mentioned! It was straightforward to translate the programs of chapters 1–3 to JavaScript by adding libraries that mirror Scheme primitives—including support for list struc- ture—and adapting the text accordingly. However, the switch to JavaScript forced us to make subtle changes in the interpreters and compiler of chapters 4 and 5 in order to handle return statements. Scheme’s expression-oriented syntax doesn’t have return statements, which are a prominent feature of statement-oriented languages. By using JavaScript, chapters 1–3 introduce the reader to the syntactic style of most mainstream languages today. However, that same syntactic style gave rise to significant changes in chapter 4, because the direct representation of programs as data structures could no longer be taken for granted. This provided us with an op- portunity to introduce the reader to the notion of program parsing in section 4.1, an important component of programming-language processors. In section 4.4, the rigid syntactic structure of JavaScript complicated the implementation of the presented
  • 26. xxii Preface logic programming system and exposed the limitations of JavaScript as a tool for programming language design. Resources for using SICP JS The MIT Press web page for SICP JS links to support for users of this book. This provides all programs from the book and extensive instructor resources, including a large collection of additional exercises and recommendations on selecting a subset of SICP JS that can be covered in a typical college semester. The JavaScript pro- grams in the book run in the recommended strict mode in any JavaScript interpreter that complies with the ECMAScript 2020 specification of JavaScript (ECMA 2020). The MIT Press web page includes the JavaScript package sicp, which provides all JavaScript functions that are considered “primitive” in the book. To the reader We sincerely hope that if this book is your first encounter with programming you will use your newly gained understanding of the structure and interpretation of computer programs to learn more programming languages, including Scheme and the full JavaScript language. If you have learned JavaScript prior to picking up SICP JS, you might gain new insights into the fundamental concepts that underlie the language and discover how much can be achieved with so little. If you come to SICP JS with a knowledge of the original SICP, you might enjoy seeing familiar ideas presented in a new format—and might appreciate the online comparison edition, available at the book’s web page, where SICP JS and SICP can be viewed side by side. —Martin Henz and Tobias Wrigstad
  • 27. Prefaces to Structure and Interpretation of Computer Programs, 1996 & 1984 Preface to the Second Edition of SICP, 1996 Is it possible that software is not like anything else, that it is meant to be discarded: that the whole point is to always see it as a soap bubble? —Alan J. Perlis The material in this book has been the basis of MIT’s entry-level computer science subject since 1980. We had been teaching this material for four years when the first edition was published, and twelve more years have elapsed until the appearance of this second edition. We are pleased that our work has been widely adopted and incorporated into other texts. We have seen our students take the ideas and programs in this book and build them in as the core of new computer systems and languages. In literal realization of an ancient Talmudic pun, our students have become our builders. We are lucky to have such capable students and such accomplished builders. In preparing this edition, we have incorporated hundreds of clarifications sug- gested by our own teaching experience and the comments of colleagues at MIT and elsewhere. We have redesigned most of the major programming systems in the book, including the generic-arithmetic system, the interpreters, the register-machine simulator, and the compiler; and we have rewritten all the program examples to ensure that any Scheme implementation conforming to the IEEE Scheme standard (IEEE 1990) will be able to run the code. This edition emphasizes several new themes. The most important of these is the central role played by different approaches to dealing with time in computa- tional models: objects with state, concurrent programming, functional programming, lazy evaluation, and nondeterministic programming. We have included new sections on concurrency and nondeterminism, and we have tried to integrate this theme throughout the book. The first edition of the book closely followed the syllabus of our MIT one- semester subject. With all the new material in the second edition, it will not be possible to cover everything in a single semester, so the instructor will have to pick and choose. In our own teaching, we sometimes skip the section on logic program- ming (section 4.4), we have students use the register-machine simulator but we do not cover its implementation (section 5.2), and we give only a cursory overview of the compiler (section 5.5). Even so, this is still an intense course. Some instructors may wish to cover only the first three or four chapters, leaving the other material for subsequent courses. The World Wide Web site of MIT Press provides support for users of this book. This includes programs from the book, sample programming assignments, supple- mentary materials, and downloadable implementations of the Scheme dialect of Lisp. —Harold Abelson and Gerald Jay Sussman
  • 28. xxiv Prefaces to SICP, 1996 & 1984 Preface to the First Edition of SICP, 1984 A computer is like a violin. You can imagine a novice trying first a phonograph and then a violin. The latter, he says, sounds terrible. That is the argument we have heard from our humanists and most of our computer scientists. Computer programs are good, they say, for particular purposes, but they aren’t flexible. Neither is a violin, or a typewriter, until you learn how to use it. —Marvin Minsky, “Why Programming Is a Good Medium for Expressing Poorly-Understood and Sloppily-Formulated Ideas” “The Structure and Interpretation of Computer Programs” is the entry-level subject in computer science at the Massachusetts Institute of Technology. It is required of all students at MIT who major in electrical engineering or in computer science, as one-fourth of the “common core curriculum,” which also includes two subjects on circuits and linear systems and a subject on the design of digital systems. We have been involved in the development of this subject since 1978, and we have taught this material in its present form since the fall of 1980 to between 600 and 700 students each year. Most of these students have had little or no prior formal training in computation, although many have played with computers a bit and a few have had extensive programming or hardware-design experience. Our design of this introductory computer-science subject reflects two major con- cerns. First, we want to establish the idea that a computer language is not just a way of getting a computer to perform operations but rather that it is a novel formal medium for expressing ideas about methodology. Thus, programs must be written for people to read, and only incidentally for machines to execute. Second, we believe that the essential material to be addressed by a subject at this level is not the syntax of particular programming-language constructs, nor clever algorithms for computing particular functions efficiently, nor even the mathematical analysis of algorithms and the foundations of computing, but rather the techniques used to control the intellectual complexity of large software systems. Our goal is that students who complete this subject should have a good feel for the elements of style and the aesthetics of programming. They should have command of the major techniques for controlling complexity in a large system. They should be capable of reading a 50-page-long program, if it is written in an exemplary style. They should know what not to read, and what they need not understand at any moment. They should feel secure about modifying a program, retaining the spirit and style of the original author. These skills are by no means unique to computer programming. The techniques we teach and draw upon are common to all of engineering design. We control complexity by building abstractions that hide details when appropriate. We control complexity by establishing conventional interfaces that enable us to construct sys- tems by combining standard, well-understood pieces in a “mix and match” way. We control complexity by establishing new languages for describing a design, each of which emphasizes particular aspects of the design and deemphasizes others. Underlying our approach to this subject is our conviction that “computer sci- ence” is not a science and that its significance has little to do with computers. The
  • 29. Prefaces to SICP, 1996 & 1984 xxv computer revolution is a revolution in the way we think and in the way we express what we think. The essence of this change is the emergence of what might best be called procedural epistemology—the study of the structure of knowledge from an imperative point of view, as opposed to the more declarative point of view taken by classical mathematical subjects. Mathematics provides a framework for dealing precisely with notions of “what is.” Computation provides a framework for dealing precisely with notions of “how to.” In teaching our material we use a dialect of the programming language Lisp. We never formally teach the language, because we don’t have to. We just use it, and students pick it up in a few days. This is one great advantage of Lisp-like languages: They have very few ways of forming compound expressions, and almost no syntactic structure. All of the formal properties can be covered in an hour, like the rules of chess. After a short time we forget about syntactic details of the language (because there are none) and get on with the real issues—figuring out what we want to compute, how we will decompose problems into manageable parts, and how we will work on the parts. Another advantage of Lisp is that it supports (but does not enforce) more of the large-scale strategies for modular decomposition of programs than any other language we know. We can make procedural and data abstractions, we can use higher-order functions to capture common patterns of usage, we can model local state using assignment and data mutation, we can link parts of a program with streams and delayed evaluation, and we can easily implement embedded languages. All of this is embedded in an interactive environment with excellent support for incremental program design, construction, testing, and debugging. We thank all the generations of Lisp wizards, starting with John McCarthy, who have fashioned a fine tool of unprecedented power and elegance. Scheme, the dialect of Lisp that we use, is an attempt to bring together the power and elegance of Lisp and Algol. From Lisp we take the metalinguistic power that derives from the simple syntax, the uniform representation of programs as data objects, and the garbage-collected heap-allocated data. From Algol we take lexical scoping and block structure, which are gifts from the pioneers of programming- language design who were on the Algol committee. We wish to cite John Reynolds and Peter Landin for their insights into the relationship of Church’s lambda calculus to the structure of programming languages. We also recognize our debt to the math- ematicians who scouted out this territory decades before computers appeared on the scene. These pioneers include Alonzo Church, Barkley Rosser, Stephen Kleene, and Haskell Curry. —Harold Abelson and Gerald Jay Sussman
  • 31. Acknowledgments The JavaScript adaptation of Structure and Interpretation of Computer Programs (SICP JS) was developed at the National University of Singapore (NUS) for the course CS1101S. The course was co-taught for six years and counting by Low Kok Lim, whose sound pedagogical judgment was crucial for the success of the course and this project. The CS1101S teaching team has included many NUS colleagues and more than 300 undergraduate student assistants. Their continuous feedback over the past nine years allowed us to resolve countless JavaScript-specific issues and remove unnecessary complications and yet retain the essential features of both SICP and JavaScript. SICP JS is a software project in addition to a book project. We obtained the L A TEX book sources from the original authors in 2008. An early SICP JS tool chain was developed by Liu Hang and refined by Feng Piaopiao. Chan Ger Hean developed the first tools for the print edition, based on which Jolyn Tan developed the tools for the first e-book edition and He Xinyue and Wang Qian repurposed these tools for the current comparison edition. Samuel Fang designed and developed the online edition of SICP JS. The online edition of SICP JS and CS1101S rely heavily on a software sys- tem called Source Academy, and the JavaScript sublanguages it supports are called Source. Many dozens of students have contributed to the Source Academy during the preparation of SICP JS, and the system lists them prominently as “Contribu- tors.” Since 2020, the students of the NUS course CS4215, Programming Language Implementation, contributed several programming language implementations that are used in SICP JS: The concurrent version of Source used in section 3.4 was developed by Zhengqun Koo and Jonathan Chan; the lazy implementation used in section 4.2 was developed by Jellouli Ahmed, Ian Kendall Duncan, Cruz Jomari Evangelista, and Alden Tan; the nondeterministic implementation used in section 4.3 was developed by Arsalan Cheema and Anubhav; and Daryl Tan helped integrate these implementations into the Academy. We are grateful to STINT, The Swedish Foundation for International Coopera- tion in Research and Higher Education, whose sabbatical program connected Martin and Tobias and allowed Tobias to work as a co-teacher of CS1101S and join the SICP JS project. We would like to acknowledge the courageous work of the committee of ECMA- Script 2015, led by Allen Wirfs-Brock. SICP JS relies heavily on constant and let declarations and lambda expressions, all of which were added to JavaScript with ECMAScript 2015. Those additions allowed us to stay close to the original in the presentation of the most important ideas of SICP. Guy Lewis Steele Jr., who led the first ECMAScript standardization, provided detailed and useful feedback on some exercises of chapter 4. —Martin Henz and Tobias Wrigstad
  • 32. xxviii Acknowledgements Acknowledgments from the Second Edition of SICP, 1996 We would like to thank the many people who have helped us develop this book and this curriculum. Our subject is a clear intellectual descendant of “6.231,” a wonderful subject on programming linguistics and the lambda calculus taught at MIT in the late 1960s by Jack Wozencraft and Arthur Evans, Jr. We owe a great debt to Robert Fano, who reorganized MIT’s introductory cur- riculum in electrical engineering and computer science to emphasize the principles of engineering design. He led us in starting out on this enterprise and wrote the first set of subject notes from which this book evolved. Much of the style and aesthetics of programming that we try to teach were de- veloped in conjunction with Guy Lewis Steele Jr., who collaborated with Gerald Jay Sussman in the initial development of the Scheme language. In addition, David Turner, Peter Henderson, Dan Friedman, David Wise, and Will Clinger have taught us many of the techniques of the functional programming community that appear in this book. Joel Moses taught us about structuring large systems. His experience with the Macsyma system for symbolic computation provided the insight that one should avoid complexities of control and concentrate on organizing the data to reflect the real structure of the world being modeled. Marvin Minsky and Seymour Papert formed many of our attitudes about pro- gramming and its place in our intellectual lives. To them we owe the understanding that computation provides a means of expression for exploring ideas that would oth- erwise be too complex to deal with precisely. They emphasize that a student’s ability to write and modify programs provides a powerful medium in which exploring becomes a natural activity. We also strongly agree with Alan Perlis that programming is lots of fun and we had better be careful to support the joy of programming. Part of this joy derives from observing great masters at work. We are fortunate to have been apprentice programmers at the feet of Bill Gosper and Richard Greenblatt. It is difficult to identify all the people who have contributed to the development of our curriculum. We thank all the lecturers, recitation instructors, and tutors who have worked with us over the past fifteen years and put in many extra hours on our subject, especially Bill Siebert, Albert Meyer, Joe Stoy, Randy Davis, Louis Braida, Eric Grimson, Rod Brooks, Lynn Stein, and Peter Szolovits. We would like to specially acknowledge the outstanding teaching contributions of Franklyn Turbak, now at Wellesley; his work in undergraduate instruction set a standard that we can all aspire to. We are grateful to Jerry Saltzer and Jim Miller for helping us grapple with the mysteries of concurrency, and to Peter Szolovits and David McAllester for their contributions to the exposition of nondeterministic evaluation in chapter 4. Many people have put in significant effort presenting this material at other uni- versities. Some of the people we have worked closely with are Jacob Katzenelson at the Technion, Hardy Mayer at the University of California at Irvine, Joe Stoy at Oxford, Elisha Sacks at Purdue, and Jan Komorowski at the Norwegian University of Science and Technology. We are exceptionally proud of our colleagues who have
  • 33. Acknowledgements xxix received major teaching awards for their adaptations of this subject at other univer- sities, including Kenneth Yip at Yale, Brian Harvey at the University of California at Berkeley, and Dan Huttenlocher at Cornell. Al Moyé arranged for us to teach this material to engineers at Hewlett-Packard, and for the production of videotapes of these lectures. We would like to thank the tal- ented instructors—in particular Jim Miller, Bill Siebert, and Mike Eisenberg—who have designed continuing education courses incorporating these tapes and taught them at universities and industry all over the world. Many educators in other countries have put in significant work translating the first edition. Michel Briand, Pierre Chamard, and André Pic produced a French edition; Susanne Daniels-Herold produced a German edition; and Fumio Motoyoshi produced a Japanese edition. We do not know who produced the Chinese edition, but we consider it an honor to have been selected as the subject of an “unauthorized” translation. It is hard to enumerate all the people who have made technical contributions to the development of the Scheme systems we use for instructional purposes. In addition to Guy Steele, principal wizards have included Chris Hanson, Joe Bowbeer, Jim Miller, Guillermo Rozas, and Stephen Adams. Others who have put in significant time are Richard Stallman, Alan Bawden, Kent Pitman, Jon Taft, Neil Mayle, John Lamping, Gwyn Osnos, Tracy Larrabee, George Carrette, Soma Chaudhuri, Bill Chiarchiaro, Steven Kirsch, Leigh Klotz, Wayne Noss, Todd Cass, Patrick O’Donnell, Kevin Theobald, Daniel Weise, Kenneth Sinclair, Anthony Courtemanche, Henry M. Wu, Andrew Berlin, and Ruth Shyu. Beyond the MIT implementation, we would like to thank the many people who worked on the IEEE Scheme standard, including William Clinger and Jonathan Rees, who edited the R4RS, and Chris Haynes, David Bartley, Chris Hanson, and Jim Miller, who prepared the IEEE standard. Dan Friedman has been a long-time leader of the Scheme community. The community’s broader work goes beyond issues of language design to encompass significant educational innovations, such as the high-school curriculum based on EdScheme by Schemer’s Inc., and the wonderful books by Mike Eisenberg and by Brian Harvey and Matthew Wright. We appreciate the work of those who contributed to making this a real book, especially Terry Ehling, Larry Cohen, and Paul Bethge at the MIT Press. Ella Mazel found the wonderful cover image. For the second edition we are particularly grate- ful to Bernard and Ella Mazel for help with the book design, and to David Jones, TEX wizard extraordinaire. We also are indebted to those readers who made pene- trating comments on the new draft: Jacob Katzenelson, Hardy Mayer, Jim Miller, and especially Brian Harvey, who did unto this book as Julie did unto his book Simply Scheme. Finally, we would like to acknowledge the support of the organizations that have encouraged this work over the years, including support from Hewlett-Packard, made possible by Ira Goldstein and Joel Birnbaum, and support from DARPA, made possible by Bob Kahn. —Harold Abelson and Gerald Jay Sussman
  • 35. Structure and Interpretation of Computer Programs JavaScript Edition
  • 37. 1 Building Abstractions with Functions The acts of the mind, wherein it exerts its power over simple ideas, are chiefly these three: 1. Combining several simple ideas into one compound one, and thus all complex ideas are made. 2. The second is bringing two ideas, whether simple or complex, together, and setting them by one another so as to take a view of them at once, without uniting them into one, by which it gets all its ideas of relations. 3. The third is separating them from all other ideas that accompany them in their real existence: this is called abstraction, and thus all its general ideas are made. —John Locke, An Essay Concerning Human Understanding (1690) We are about to study the idea of a computational process. Computational processes are abstract beings that inhabit computers. As they evolve, processes manipulate other abstract things called data. The evolution of a process is directed by a pattern of rules called a program. People create programs to direct processes. In effect, we conjure the spirits of the computer with our spells. A computational process is indeed much like a sorcerer’s idea of a spirit. It cannot be seen or touched. It is not composed of matter at all. However, it is very real. It can perform intellectual work. It can answer questions. It can affect the world by disbursing money at a bank or by controlling a robot arm in a factory. The programs we use to conjure processes are like a sorcerer’s spells. They are carefully composed from symbolic expressions in arcane and esoteric programming languages that prescribe the tasks we want our processes to perform. A computational process, in a correctly working computer, executes programs precisely and accurately. Thus, like the sorcerer’s apprentice, novice programmers must learn to understand and to anticipate the consequences of their conjuring. Even small errors (usually called bugs) in programs can have complex and unanticipated consequences. Fortunately, learning to program is considerably less dangerous than learning sorcery, because the spirits we deal with are conveniently contained in a secure way. Real-world programming, however, requires care, expertise, and wisdom. A small bug in a computer-aided design program, for example, can lead to the catastrophic collapse of an airplane or a dam or the self-destruction of an industrial robot. Master software engineers have the ability to organize programs so that they can be reasonably sure that the resulting processes will perform the tasks intended. They can visualize the behavior of their systems in advance. They know how to structure programs so that unanticipated problems do not lead to catastrophic consequences, and when problems do arise, they can debug their programs. Well-designed compu- tational systems, like well-designed automobiles or nuclear reactors, are designed in a modular manner, so that the parts can be constructed, replaced, and debugged separately.
  • 38. 2 Chapter 1 Building Abstractions with Functions Programming in JavaScript We need an appropriate language for describing processes, and we will use for this purpose the programming language JavaScript. Just as our everyday thoughts are usually expressed in our natural language (such as English, Swedish, or Chinese), and descriptions of quantitative phenomena are expressed with mathematical no- tations, our procedural thoughts will be expressed in JavaScript. JavaScript was developed in 1995 as a programming language for controlling the behavior of World Wide Web browsers through scripts that are embedded in web pages. The language was conceived by Brendan Eich, originally under the name Mocha, which was later renamed to LiveScript, and finally to JavaScript. The name “JavaScript” is a trademark of Oracle Corporation. Despite its inception as a language for scripting the web, JavaScript is a general- purpose programming language. A JavaScript interpreter is a machine that car- ries out processes described in the JavaScript language. The first JavaScript inter- preter was implemented by Eich at Netscape Communications Corporation for the Netscape Navigator web browser. JavaScript inherited its core features from the Scheme and Self programming languages. Scheme is a dialect of Lisp, and was used as the programming language for the original version of this book. From Scheme, JavaScript inherited its most fundamental design principles, such as lexically scoped first-class functions and dynamic typing. JavaScript bears only superficial resemblance to the language Java, after which it was (eventually) named; both Java and JavaScript use the block structure of the language C. In contrast with Java and C, which usually employ compilation to lower- level languages, JavaScript programs were initially interpreted by web browsers. After Netscape Navigator, other web browsers provided interpreters for the language, including Microsoft’s Internet Explorer, whose JavaScript version is called JScript. The popularity of JavaScript for controlling web browsers gave rise to a standard- ization effort, culminating in ECMAScript. The first edition of the ECMAScript standard was led by Guy Lewis Steele Jr. and completed in June 1997 (ECMA 1997). The sixth edition, known as ECMAScript 2015, was led by Allen Wirfs-Brock and adopted by the General Assembly of ECMA in June 2015 (ECMA 2015). The practice of embedding JavaScript programs in web pages encouraged the developers of web browsers to implement JavaScript interpreters. As these programs became more complex, the interpreters became more efficient in executing them, eventually using sophisticated implementation techniques such as Just-In-Time (JIT) compilation. The majority of JavaScript programs as of this writing (2021) are em- bedded in web pages and interpreted by browsers, but JavaScript is increasingly used as a general-purpose programming language, using systems such as Node.js. ECMAScript 2015 possesses a set of features that make it an excellent medium for studying important programming constructs and data structures and for relat- ing them to the linguistic features that support them. Its lexically scoped first-class functions and their syntactic support through lambda expressions provide direct and concise access to functional abstraction, and dynamic typing allows the adaptation to remain close to the Scheme original throughout the book. Above and beyond these considerations, programming in JavaScript is great fun.
  • 39. 1.1 The Elements of Programming 3 1.1 The Elements of Programming A powerful programming language is more than just a means for instructing a computer to perform tasks. The language also serves as a framework within which we organize our ideas about processes. Thus, when we describe a language, we should pay particular attention to the means that the language provides for combin- ing simple ideas to form more complex ideas. Every powerful language has three mechanisms for accomplishing this: • primitive expressions, which represent the simplest entities the language is con- cerned with, • means of combination, by which compound elements are built from simpler ones, and • means of abstraction, by which compound elements can be named and manipu- lated as units. In programming, we deal with two kinds of elements: functions and data. (Later we will discover that they are really not so distinct.) Informally, data is “stuff” that we want to manipulate, and functions are descriptions of the rules for manipulating the data. Thus, any powerful programming language should be able to describe primitive data and primitive functions and should have methods for combining and abstracting functions and data. In this chapter we will deal only with simple numerical data so that we can focus on the rules for building functions.1 In later chapters we will see that these same rules allow us to build functions to manipulate compound data as well. 1.1.1 Expressions One easy way to get started at programming is to examine some typical interac- tions with an interpreter for the JavaScript language. You type a statement, and the interpreter responds by displaying the result of its evaluating that statement. One kind of statement you might type is an expression statement, which consists of an expression followed by a semicolon. One kind of primitive expression is a number. (More precisely, the expression that you type consists of the numerals that represent the number in base 10.) If you present JavaScript with the program 1. The characterization of numbers as “simple data” is a barefaced bluff. In fact, the treatment of numbers is one of the trickiest and most confusing aspects of any programming language. Some typical issues involved are these: Some computer systems distinguish integers, such as 2, from real numbers, such as 2.71. Is the real number 2.00 different from the integer 2? Are the arithmetic operations used for integers the same as the operations used for real numbers? Does 6 divided by 2 produce 3, or 3.0? How large a number can we represent? How many decimal places of accuracy can we represent? Is the range of integers the same as the range of real numbers? Above and beyond these questions, of course, lies a collection of issues concerning roundoff and truncation errors—the entire science of numerical analysis. Since our focus in this book is on large-scale program design rather than on numerical techniques, we are going to ignore these problems. The numerical examples in this chapter will exhibit the usual roundoff behavior that one observes when using arithmetic operations that preserve a limited number of decimal places of accuracy in noninteger operations.
  • 40. 4 Chapter 1 Building Abstractions with Functions 486; the interpreter will respond by printing2 486 Expressions representing numbers may be combined with operators (such as + or *) to form a compound expression that represents the application of a correspond- ing primitive function to those numbers. For example, 137 + 349; 486 1000 - 334; 666 5 * 99; 495 10 / 4; 2.5 2.7 + 10; 12.7 Expressions such as these, which contain other expressions as components, are called combinations. Combinations that are formed by an operator symbol in the middle, and operand expressions to the left and right of it, are called operator com- binations. The value of an operator combination is obtained by applying the function specified by the operator to the arguments that are the values of the operands. The convention of placing the operator between the operands is known as infix notation. It follows the mathematical notation that you are most likely familiar with from school and everyday life. As in mathematics, operator combinations can be nested, that is, they can have operands that themselves are operator combinations: (3 * 5) + (10 - 6); 19 As usual, parentheses are used to group operator combinations in order to avoid am- biguities. JavaScript also follows the usual conventions when parentheses are omit- ted: multiplication and division bind more strongly than addition and subtraction. For example, 3 * 5 + 10 / 2; stands for (3 * 5) + (10 / 2); 2. Throughout this book, we distinguish between the input typed by the user and any text printed by the interpreter by showing the latter in slanted characters.
  • 41. 1.1.2 Naming and the Environment 5 We say that * and / have higher precedence than + and -. Sequences of additions and subtractions are read from left to right, as are sequences of multiplications and divisions. Thus, 1 - 5 / 2 * 4 + 3; stands for (1 - ((5 / 2) * 4)) + 3; We say that the operators +, -, * and / are left-associative. There is no limit (in principle) to the depth of such nesting and to the overall complexity of the expressions that the JavaScript interpreter can evaluate. It is we humans who might get confused by still relatively simple expressions such as 3 * 2 * (3 - 5 + 4) + 27 / 6 * 10; which the interpreter would readily evaluate to be 57. We can help ourselves by writing such an expression in the form 3 * 2 * (3 - 5 + 4) + 27 / 6 * 10; to visually separate the major components of the expression. Even with complex expressions, the interpreter always operates in the same basic cycle: It reads a statement typed by the user, evaluates the statement, and prints the result. This mode of operation is often expressed by saying that the interpreter runs in a read-evaluate-print loop. Observe in particular that it is not necessary to explicitly instruct the interpreter to print the value of the statement.3 1.1.2 Naming and the Environment A critical aspect of a programming language is the means it provides for using names to refer to computational objects, and our first such means are constants. We say that the name identifies a constant whose value is the object. In JavaScript, we name constants with constant declarations. const size = 2; causes the interpreter to associate the value 2 with the name size.4 Once the name size has been associated with the number 2, we can refer to the value 2 by name: 3. JavaScript obeys the convention that every statement has a value (see exercise 4.8). This convention, together with the reputation of JavaScript programmers as not caring about effi- ciency, leads us to paraphrase a quip on Lisp programmers by Alan Perlis (who was himself paraphrasing Oscar Wilde): JavaScript programmers know the value of everything but the cost of nothing. 4. In this book, we do not show the interpreter’s response to evaluating programs that end with declarations, since this might depend on previous statements. See exercise 4.8 for details.
  • 42. 6 Chapter 1 Building Abstractions with Functions size; 2 5 * size; 10 Here are further examples of the use of const: const pi = 3.14159; const radius = 10; pi * radius * radius; 314.159 const circumference = 2 * pi * radius; circumference; 62.8318 Constant declaration is our language’s simplest means of abstraction, for it al- lows us to use simple names to refer to the results of compound operations, such as the circumference computed above. In general, computational objects may have very complex structures, and it would be extremely inconvenient to have to remember and repeat their details each time we want to use them. Indeed, com- plex programs are constructed by building, step by step, computational objects of increasing complexity. The interpreter makes this step-by-step program con- struction particularly convenient because name-object associations can be created incrementally in successive interactions. This feature encourages the incremental development and testing of programs and is largely responsible for the fact that a JavaScript program usually consists of a large number of relatively simple functions. It should be clear that the possibility of associating values with names and later retrieving them means that the interpreter must maintain some sort of memory that keeps track of the name-object pairs. This memory is called the environment (more precisely the program environment, since we will see later that a computation may involve a number of different environments).5 1.1.3 Evaluating Operator Combinations One of our goals in this chapter is to isolate issues about thinking procedurally. As a case in point, let us consider that, in evaluating operator combinations, the interpreter is itself following a procedure. • To evaluate an operator combination, do the following: 1. Evaluate the operand expressions of the combination. 2. Apply the function that is denoted by the operator to the arguments that are the values of the operands. 5. Chapter 3 will show that this notion of environment is crucial for understanding how the interpreter works. Chapter 4 will use environments for implementing interpreters.
  • 43. 1.1.3 Evaluating Operator Combinations 7 15 26 24 2 390 12 3 6 4 + * * + Figure 1.1 Tree representation, showing the value of each subexpression. Even this simple rule illustrates some important points about processes in general. First, observe that the first step dictates that in order to accomplish the evaluation process for a combination we must first perform the evaluation process on each operand of the combination. Thus, the evaluation rule is recursive in nature; that is, it includes, as one of its steps, the need to invoke the rule itself. Notice how succinctly the idea of recursion can be used to express what, in the case of a deeply nested combination, would otherwise be viewed as a rather complicated process. For example, evaluating (2 + 4 * 6) * (3 + 12); requires that the evaluation rule be applied to four different combinations. We can obtain a picture of this process by representing the combination in the form of a tree, as shown in figure 1.1. Each combination is represented by a node with branches corresponding to the operator and the operands of the combination stemming from it. The terminal nodes (that is, nodes with no branches stemming from them) rep- resent either operators or numbers. Viewing evaluation in terms of the tree, we can imagine that the values of the operands percolate upward, starting from the terminal nodes and then combining at higher and higher levels. In general, we shall see that recursion is a very powerful technique for dealing with hierarchical, treelike objects. In fact, the “percolate values upward” form of the evaluation rule is an example of a general kind of process known as tree accumulation. Next, observe that the repeated application of the first step brings us to the point where we need to evaluate, not combinations, but primitive expressions such as numerals or names. We take care of the primitive cases by stipulating that • the values of numerals are the numbers that they name, and • the values of names are the objects associated with those names in the environ- ment. The key point to notice is the role of the environment in determining the meaning of the names in expressions. In an interactive language such as JavaScript, it is meaningless to speak of the value of an expression such as x + 1 without speci- fying any information about the environment that would provide a meaning for the name x. As we shall see in chapter 3, the general notion of the environment as
  • 44. 8 Chapter 1 Building Abstractions with Functions providing a context in which evaluation takes place will play an important role in our understanding of program execution. Notice that the evaluation rule given above does not handle declarations. For instance, evaluating const x = 3; does not apply an equality operator = to two arguments, one of which is the value of the name x and the other of which is 3, since the purpose of the declaration is precisely to associate x with a value. (That is, const x = 3; is not a combination.) The letters in const are rendered in bold to indicate that it is a keyword in JavaScript. Keywords carry a particular meaning, and thus cannot be used as names. A keyword or a combination of keywords in a statement instructs the JavaScript interpreter to treat the statement in a special way. Each such syntactic form has its own evaluation rule. The various kinds of statements and expressions (each with its associated evaluation rule) constitute the syntax of the programming language. 1.1.4 Compound Functions We have identified in JavaScript some of the elements that must appear in any powerful programming language: • Numbers and arithmetic operations are primitive data and functions. • Nesting of combinations provides a means of combining operations. • Constant declarations that associate names with values provide a limited means of abstraction. Now we will learn about function declarations, a much more powerful abstraction technique by which a compound operation can be given a name and then referred to as a unit. We begin by examining how to express the idea of “squaring.” We might say, “To square something, take it times itself.” This is expressed in our language as function square(x) { return x * x; } We can understand this in the following way: function square( x ) { return x * x ; } x   x   x   x   x   x   To square something, take it times itself. We have here a compound function, which has been given the name square. The function represents the operation of multiplying something by itself. The thing to be multiplied is given a local name, x, which plays the same role that a pronoun plays in natural language. Evaluating the declaration creates this compound function and associates it with the name square.6 6. Observe that there are two different operations being combined here: we are creating the function, and we are giving it the name square. It is possible, indeed important, to be able to separate these two notions—to create functions without naming them, and to give names to functions that have already been created. We will see how to do this in section 1.3.2.
  • 45. 1.1.4 Compound Functions 9 The simplest form of a function declaration is function name(parameters) { return expression; } The name is a symbol to be associated with the function definition in the envi- ronment.7 The parameters are the names used within the body of the function to refer to the corresponding arguments of the function. The parameters are grouped within parentheses and separated by commas, as they will be in an application of the function being declared. In the simplest form, the body of a function declaration is a single return statement,8 which consists of the keyword return followed by the return expression that will yield the value of the function application, when the parameters are replaced by the actual arguments to which the function is applied. Like constant declarations and expression statements, return statements end with a semicolon. Having declared square, we can now use it in a function application expression, which we turn into a statement using a semicolon: square(21); 441 Function applications are—after operator combinations—the second kind of combi- nation of expressions into larger expressions that we encounter. The general form of a function application is function-expression(argument-expressions) where the function-expression of the application specifies the function to be applied to the comma-separated argument-expressions. To evaluate a function application, the interpreter follows a procedure quite similar to the procedure for operator combinations described in section 1.1.3. • To evaluate a function application, do the following: 1. Evaluate the subexpressions of the application, namely the function expression and the argument expressions. 2. Apply the function that is the value of the function expression to the values of the argument expressions. square(2 + 5); 49 Here, the argument expression is itself a compound expression, the operator combi- nation 2 + 5. 7. Throughout this book, we will describe the general syntax of expressions by using italic symbols—e.g., name—to denote the “slots” in the expression to be filled in when such an expression is actually used. 8. More generally, the body of the function can be a sequence of statements. In this case, the interpreter evaluates each statement in the sequence in turn until a return statement determines the value of the function application.
  • 46. 10 Chapter 1 Building Abstractions with Functions square(square(3)); 81 Of course function application expressions can also serve as argument expressions. We can also use square as a building block in defining other functions. For example, x2 + y2 can be expressed as square(x) + square(y) We can easily declare a function sum_of_squares9 that, given any two numbers as arguments, produces the sum of their squares: function sum_of_squares(x, y) { return square(x) + square(y); } sum_of_squares(3, 4); 25 Now we can use sum_of_squares as a building block in constructing further functions: function f(a) { return sum_of_squares(a + 1, a * 2); } f(5); 136 In addition to compound functions, any JavaScript environment provides prim- itive functions that are built into the interpreter or loaded from libraries. Besides the primitive functions provided by the operators, the JavaScript environment used in this book includes additional primitive functions such as the function math_log, which computes the natural logarithm of its argument.10 These additional primitive functions are used in exactly the same way as compound functions; evaluating the application math_log(1) results in the number 0. Indeed, one could not tell by looking at the definition of sum_of_squares given above whether square was built into the interpreter, loaded from a library, or defined as a compound function. 9. The way multi-part names such as sum_of_squares are written affects the readability of programs, and programming communities differ on this. According to the common JavaScript convention, called camel case, the name would be sumOfSquares. The convention used in this book is called snake case, and was chosen for its closer resemblance to the convention used in the Scheme version of this book, where hyphens play the role of our underscores. 10. Our JavaScript environment includes all functions and constants of ECMAScript’s Math object, under the names math_. . .. For example, ECMAScript’s Math.log is available as math_log. The MIT Press web page for this book includes the JavaScript package sicp that provides these and all other JavaScript functions that are considered primitive in the book.
  • 47. 1.1.5 The Substitution Model for Function Application 11 1.1.5 The Substitution Model for Function Application To evaluate a function application, the interpreter follows the process described in section 1.1.4. That is, the interpreter evaluates the elements of the application and ap- plies the function (which is the value of the function expression of the application) to the arguments (which are the values of the argument expressions of the application). We can assume that the application of primitive functions is handled by the in- terpreter or libraries. For compound functions, the application process is as follows: • To apply a compound function to arguments, evaluate the return expression of the function with each parameter replaced by the corresponding argument.11 To illustrate this process, let’s evaluate the application f(5) where f is the function declared in section 1.1.4. We begin by retrieving the return expression of f: sum_of_squares(a + 1, a * 2) Then we replace the parameter a by the argument 5: sum_of_squares(5 + 1, 5 * 2) Thus the problem reduces to the evaluation of an application with two arguments and a function expression sum_of_squares. Evaluating this application involves three subproblems. We must evaluate the function expression to get the function to be applied, and we must evaluate the argument expressions to get the arguments. Now 5 + 1 produces 6 and 5 * 2 produces 10, so we must apply the sum_of_squares function to 6 and 10. These values are substituted for the parameters x and y in the body of sum_of_squares, reducing the expression to square(6) + square(10) If we use the declaration of square, this reduces to (6 * 6) + (10 * 10) which reduces by multiplication to 36 + 100 and finally to 136 11. If the body of the function is a sequence of statements, the body is evaluated with the parameters replaced, and the value of the application is the value of the return expression of the first return statement encountered.
  • 48. 12 Chapter 1 Building Abstractions with Functions The process we have just described is called the substitution model for function application. It can be taken as a model that determines the “meaning” of function application, insofar as the functions in this chapter are concerned. However, there are two points that should be stressed: • The purpose of the substitution is to help us think about function application, not to provide a description of how the interpreter really works. Typical interpreters do not evaluate function applications by manipulating the text of a function to sub- stitute values for the parameters. In practice, the “substitution” is accomplished by using a local environment for the parameters. We will discuss this more fully in chapters 3 and 4 when we examine the implementation of an interpreter in detail. • Over the course of this book, we will present a sequence of increasingly elaborate models of how interpreters work, culminating with a complete implementation of an interpreter and compiler in chapter 5. The substitution model is only the first of these models—a way to get started thinking formally about the evaluation process. In general, when modeling phenomena in science and engineering, we begin with simplified, incomplete models. As we examine things in greater detail, these simple models become inadequate and must be replaced by more refined models. The substitution model is no exception. In particular, when we address in chapter 3 the use of functions with “mutable data,” we will see that the substitu- tion model breaks down and must be replaced by a more complicated model of function application.12 Applicative order versus normal order According to the description of evaluation given in section 1.1.4, the interpreter first evaluates the function and argument expressions and then applies the resulting function to the resulting arguments. This is not the only way to perform evaluation. An alternative evaluation model would not evaluate the arguments until their values were needed. Instead it would first substitute argument expressions for parameters until it obtained an expression involving only operators and primitive functions, and would then perform the evaluation. If we used this method, the evaluation of f(5) would proceed according to the sequence of expansions sum_of_squares(5 + 1, 5 * 2) square(5 + 1) + square(5 * 2) (5 + 1) * (5 + 1) + (5 * 2) * (5 * 2) 12. Despite the simplicity of the substitution idea, it turns out to be surprisingly complicated to give a rigorous mathematical definition of the substitution process. The problem arises from the possibility of confusion between the names used for the parameters of a function and the (possibly identical) names used in the expressions to which the function may be applied. Indeed, there is a long history of erroneous definitions of substitution in the literature of logic and programming semantics. See Stoy 1977 for a careful discussion of substitution.
  • 49. 1.1.6 Conditional Expressions and Predicates 13 followed by the reductions 6 * 6 + 10 * 10 36 + 100 136 This gives the same answer as our previous evaluation model, but the process is different. In particular, the evaluations of 5 + 1 and 5 * 2 are each performed twice here, corresponding to the reduction of the expression x * x with x replaced respectively by 5 + 1 and 5 * 2. This alternative “fully expand and then reduce” evaluation method is known as normal-order evaluation, in contrast to the “evaluate the arguments and then apply” method that the interpreter actually uses, which is called applicative-order evaluation. It can be shown that, for function applications that can be modeled using substitution (including all the functions in the first two chapters of this book) and that yield legitimate values, normal-order and applicative-order evaluation produce the same value. (See exercise 1.5 for an instance of an “illegitimate” value where normal-order and applicative-order evaluation do not give the same result.) JavaScript uses applicative-order evaluation, partly because of the additional ef- ficiency obtained from avoiding multiple evaluations of expressions such as those illustrated with 5 + 1 and 5 * 2 above and, more significantly, because normal- order evaluation becomes much more complicated to deal with when we leave the realm of functions that can be modeled by substitution. On the other hand, normal- order evaluation can be an extremely valuable tool, and we will investigate some of its implications in chapters 3 and 4.13 1.1.6 Conditional Expressions and Predicates The expressive power of the class of functions that we can define at this point is very limited, because we have no way to make tests and to perform different operations depending on the result of a test. For instance, we cannot declare a function that com- putes the absolute value of a number by testing whether the number is nonnegative and taking different actions in each case according to the rule |x| = x if x ≥ 0 –x otherwise This construct is a case analysis and can be written in JavaScript using a conditional expression as 13. In chapter 3 we will introduce stream processing, which is a way of handling apparently “in- finite” data structures by incorporating a limited form of normal-order evaluation. In section 4.2 we will modify the JavaScript interpreter to produce a normal-order variant of JavaScript.
  • 50. 14 Chapter 1 Building Abstractions with Functions function abs(x) { return x = 0 ? x : - x; } which could be expressed in English as “If x is greater than or equal to zero, return x; otherwise return –x.” The general form of a conditional expression is predicate ? consequent-expression : alternative-expression Conditional expressions begin with a predicate—that is, an expression whose value is either true or false, two distinguished boolean values in JavaScript. The primi- tive boolean expressions true and false trivially evaluate to the boolean values true and false, respectively. The predicate is followed by a question mark, the consequent-expression, a colon, and finally the alternative-expression. To evaluate a conditional expression, the interpreter starts by evaluating the predicate of the expression. If the predicate evaluates to true, the interpreter eval- uates the consequent-expression and returns its value as the value of the conditional. If the predicate evaluates to false, it evaluates the alternative-expression and returns its value as the value of the conditional.14 The word predicate is used for operators and functions that return true or false, as well as for expressions that evaluate to true or false. The absolute-value function abs makes use of the primitive predicate =, an operator that takes two numbers as arguments and tests whether the first number is greater than or equal to the second number, returning true or false accordingly. If we prefer to handle the zero case separately, we can specify the function that computes the absolute value of a number by writing |x| =    x if x 0 0 if x = 0 –x otherwise In JavaScript, we express a case analysis with multiple cases by nesting conditional expressions as alternative expressions inside other conditional expressions: function abs(x) { return x 0 ? x : x === 0 ? 0 : - x; } Parentheses are not needed around the alternative expression x === 0 ? 0 : - x, because the conditional-expression syntactic form is right-associative. The inter- preter ignores spaces and line breaks, here inserted for readability to align the ?’s and :’s under the first predicate of the case analysis. The general form of a case analysis is 14. Conditionals in full JavaScript accept any value, not just a boolean, as the result of evaluat- ing the predicate expression (see footnote 14 in section 4.1.3 for details). The programs in this book use only boolean values as predicates of conditionals.
  • 51. 1.1.6 Conditional Expressions and Predicates 15 p1 ? e1 : p2 ? e2 . . . : pn ? en : final-alternative-expression We call a predicate pi together with its consequent expression ei a clause. A case analysis can be seen as a sequence of clauses, followed by a final alternative ex- pression. According to the evaluation of conditional expressions, a case analysis is evaluated by first evaluating the predicate p1. If its value is false, then p2 is evaluated. If p2’s value is also false, then p3 is evaluated. This process continues until a predicate is found whose value is true, in which case the interpreter returns the value of the corresponding consequent expression e of the clause as the value of the case analysis. If none of the p’s is found to be true, the value of the case analysis is the value of the final alternative expression. In addition to primitive predicates such as =, , , =, ===, and !== that are applied to numbers,15 there are logical composition operations, which enable us to construct compound predicates. The three most frequently used are these: • expression1 expression2 This operation expresses logical conjunction, meaning roughly the same as the English word “and.” This syntactic form is syntactic sugar16 for expression1 ? expression2 : false. • expression1 || expression2 This operation expresses logical disjunction, meaning roughly the same as the English word “or.” This syntactic form is syntactic sugar for expression1 ? true : expression2. • ! expression This operation expresses logical negation, meaning roughly the same as the En- glish word “not.” The value of the expression is true when expression evaluates to false, and false when expression evaluates to true. Notice that and || are syntactic forms, not operators; their right-hand expression is not always evaluated. The operator !, on the other hand, follows the evaluation rule of section 1.1.3. It is a unary operator, which means that it takes only one argument, whereas the arithmetic operators and primitive predicates discussed so far are binary, taking two arguments. The operator ! precedes its argument; we call it a prefix operator. Another prefix operator is the numeric negation operator, an example of which is the expression - x in the abs functions above. 15. For now, we restrict these operators to number arguments. In sections 2.3.1 and 3.3.1, we shall generalize the equality and inequality predicates === and !==. 16. Syntactic forms that are simply convenient alternative surface structures for things that can be written in more uniform ways are sometimes called syntactic sugar, to use a phrase coined by Peter Landin.
  • 52. 16 Chapter 1 Building Abstractions with Functions As an example of how these predicates are used, the condition that a number x be in the range 5 x 10 may be expressed as x 5 x 10 The syntactic form has lower precedence than the comparison operators and , and the conditional-expression syntactic form · · · ?· · · :· · · has lower precedence than any other operator we have encountered so far, a property we used in the abs functions above. As another example, we can declare a predicate to test whether one number is greater than or equal to another as function greater_or_equal(x, y) { return x y || x === y; } or alternatively as function greater_or_equal(x, y) { return ! (x y); } The function greater_or_equal, when applied to two numbers, behaves the same as the operator =. Unary operators have higher precedence than binary operators, which makes the parentheses in this example necessary. Exercise 1.1 Below is a sequence of statements. What is the result printed by the interpreter in response to each statement? Assume that the sequence is to be evaluated in the order in which it is presented. 10; 5 + 3 + 4; 9 - 1; 6 / 2; 2 * 4 + (4 - 6); const a = 3; const b = a + 1; a + b + a * b; a === b; b a b a * b ? b : a; a === 4 ? 6 : b === 4 ? 6 + 7 + a : 25;
  • 53. 1.1.6 Conditional Expressions and Predicates 17 2 + (b a ? b : a); (a b ? a : a b ? b : -1) * (a + 1); The parentheses around the conditional expressions in the last two statements are necessary because the conditional-expression syntactic form has lower precedence than the arithmetic operators + and *. Exercise 1.2 Translate the following expression into JavaScript 5 + 4 + 2 – 3 – (6 + 4 5 ) 3(6 – 2)(2 – 7) Exercise 1.3 Declare a function that takes three numbers as arguments and returns the sum of the squares of the two larger numbers. Exercise 1.4 Observe that our model of evaluation allows for applications whose function expressions are compound expressions. Use this observation to describe the behavior of a_plus_abs_b: function plus(a, b) { return a + b; } function minus(a, b) { return a - b; } function a_plus_abs_b(a, b) { return (b = 0 ? plus : minus)(a, b); } Exercise 1.5 Ben Bitdiddle has invented a test to determine whether the interpreter he is faced with is using applicative-order evaluation or normal-order evaluation. He declares the following two functions: function p() { return p(); } function test(x, y) { return x === 0 ? 0 : y; } Then he evaluates the statement test(0, p()); What behavior will Ben observe with an interpreter that uses applicative-order evaluation? What behavior will he observe with an interpreter that uses normal-order evaluation? Ex- plain your answer. (Assume that the evaluation rule for conditional expressions is the
  • 54. 18 Chapter 1 Building Abstractions with Functions same whether the interpreter is using normal or applicative order: The predicate expres- sion is evaluated first, and the result determines whether to evaluate the consequent or the alternative expression.) 1.1.7 Example: Square Roots by Newton’s Method Functions, as introduced above, are much like ordinary mathematical functions. They specify a value that is determined by one or more parameters. But there is an important difference between mathematical functions and computer functions. Computer functions must be effective. As a case in point, consider the problem of computing square roots. We can define the square-root function as √ x = the y such that y ≥ 0 and y2 = x This describes a perfectly legitimate mathematical function. We could use it to recognize whether one number is the square root of another, or to derive facts about square roots in general. On the other hand, the definition does not describe a computer function. Indeed, it tells us almost nothing about how to actually find the square root of a given number. It will not help matters to rephrase this definition in pseudo-JavaScript: function sqrt(x) { return the y with y = 0 square(y) === x; } This only begs the question. The contrast between mathematical function and computer function is a reflec- tion of the general distinction between describing properties of things and describing how to do things, or, as it is sometimes referred to, the distinction between declara- tive knowledge and imperative knowledge. In mathematics we are usually concerned with declarative (what is) descriptions, whereas in computer science we are usually concerned with imperative (how to) descriptions.17 How does one compute square roots? The most common way is to use Newton’s method of successive approximations, which says that whenever we have a guess y 17. Declarative and imperative descriptions are intimately related, as indeed are mathematics and computer science. For instance, to say that the answer produced by a program is “correct” is to make a declarative statement about the program. There is a large amount of research aimed at establishing techniques for proving that programs are correct, and much of the technical difficulty of this subject has to do with negotiating the transition between imperative statements (from which programs are constructed) and declarative statements (which can be used to deduce things). In a related vein, programming language designers have explored so-called very high- level languages, in which one actually programs in terms of declarative statements. The idea is to make interpreters sophisticated enough so that, given “what is” knowledge specified by the programmer, they can generate “how to” knowledge automatically. This cannot be done in general, but there are important areas where progress has been made. We shall revisit this idea in chapter 4.
  • 55. Random documents with unrelated content Scribd suggests to you:
  • 56. nicht gekämpft um das ferne Ziel. Und da er ein Mann ward, sah er wieder einen offenen Weg vor sich; aber er war wieder umgekehrt, um anderer Menschen willen und um unklares Fühlen. Und zuletzt war die Frau in sein Leben getreten, die zu ihm gehörte, und er hatte es gar nicht gemerkt. Es war so, als kämen die zahllosen Stimmen aus dem raunend- platschenden Hinfließen und sagten es ihm alles in Worten. Noch nie war dies in deutlichem Denken in seiner Seele wach geworden. Und er sann und quälte sich und sann, wie es so gekommen war. — Er war immer so vor sich hingegangen im trüben Licht und hatte gewartet und geträumt und wieder gewartet in den weißen Nebel hinein. Der Nebel war es gewesen, der hatte es zugedeckt. Und nun war alles falsch und wirr. Konnte er es denn ertragen, dies öde Leben, und ohne sie? Er hatte sich wieder an den Boden gelegt. Er deckte den Arm über die Augen. „Ich kann nicht,“ murmelte er. Ganz, ganz leise fing es an, zwischen den trockenen Blättern zu rascheln und klappern. Dann kam ein leises, gleichförmiges Tröpfeln. Der Nebel war zum Regen geworden. Reicher, satter wurden die Farben in der Feuchtigkeit. Es kam ein farbiges Gleißen über die reglosen Blätter und die ernsten Stämme. Und geheimnisvoll wie das Rinnen des Baches klang das gleichmäßig leise, klappernde Tropfen. War denn nirgends ein starkes Frisches, nach dem er hinsehen konnte und aufstehen und vorwärtsgehen? Er merkte nichts von der großen Ordnung. Das war ein schöner Traum gewesen, den sich der alte Fischer zurecht gesponnen hatte. Es war alles wirr. Und das murmelnde Fließen rann und rann wie ein endlos mühseliges Gespinst. — Und das öde Getropfe webte ringsum mit sachtem Rascheln. Aber aus der alten Erde stieg ein feuchter Duft, und es war, als ob ein Trieb der Stärke mit aufquoll aus dem dunklen Grunde. In dem reglos Liegenden wuchs das Wollen aus den Tiefen seines Wesens herauf. — Es ist ein Wundersames um die Kraft, wie sie dem Mutterherzen der alten Erde entströmt. — Lars stand auf,
  • 57. und er sah mit dunklen Augen fest vor sich hin. Noch war er ein freier Mann, und er wollte das Leben fest anpacken. Nur eines konnte er nicht: Karen lassen. Dies starke, treue Herz, das sein innerstes, wirres Wesen verstand, die mußte ihm helfen. Vielleicht, daß noch irgendwo eine Arbeit auf ihn wartete, und wie von ungefähr stieg Christen Matthies’ trauriges Gesicht in seiner Seele auf. „Er sollte lieber den kleinen Leuten helfen, wenn er so klug ist,“ hatte Christen Matthies gesagt. So ging er durch den leise rinnenden Regen nach Hause. [5] Kleiner Bursch.
  • 58. Kapitel XXIV Die Asmussens waren durch Trinas lange Krankheit zurückgekommen. Anstatt wie sonst Geld auf die Sparkasse tragen zu können, hatten sie Geld aufnehmen müssen. Das machte Lars mißmutig. Und das ewige Gejammer der alten Lassen darüber machte es nur noch ärger. Seit der Stunde im Walde war es wie eine wunde Stelle irgendwo in seiner Seele, und das Reden und das laute Lachen trafen darauf wie Peitschenhiebe. Da ging er ins Wirtshaus, und es war ihm selbst kaum bewußt, daß es der Gedanke aus dem Walde war, der ihn hintrieb. Er setzte sich gleich zu Christen Matthies und wollte mit ihm reden über die neue Vereinigung, wie sie die Fischer in den andern Buchten hatten. Aber Christen Matthies war dänisch gesonnen, darum fuhr ihn Lars bald heftig und hochfahrend an. Da sah Christen mit den schwermütigen alten Augen fragend zu ihm auf und gab bald keine Antwort mehr. „Ja, wenn wir die Fische mit einem eigenen Dampfer zur Stadt bringen sollen, wie die andern, woher sollen wir das Geld dann für einen Dampfer nehmen?“ fragte da Trollsen dazwischen, „Christen Matthies hat recht, wenn wir uns zu den Dänen halten, kriegen wir Geld zu viel billigeren Prozenten.“ Aber in Lars war die wunde Unrast, darum konnte er ihnen nicht in Ruhe klar machen, wie er es meinte, sondern geriet in Zorn. Da schüttelten sie die Köpfe über ihn und hörten nicht mehr hin. Und bald stand er auf und ging hinaus. Er trat aus dem Dunst in den
  • 59. stillen, klaren Herbstabend hinaus. Es hatte sich abgeregnet, und eine grünleuchtende Klarheit lag über der bunten Herbstwelt. Es lag eine Dumpfheit über Lars und eine Müdigkeit. — Das war also auch nichts. Denen würde er ebenso wenig helfen können, wie sich selbst. Er sehnte sich nach einem stillen Winkel, darum ging er zu Mutter Stina in die alte Heimhütte. Zwischen den hohen, bunten Malven lag das kleine, grünbemooste Strohdachhaus wie im tiefen Schlaf, als hätte es über seinem leisen, traulichen Klingen sich und die Welt vergessen und wäre nun auch vergessen worden zwischen seiner bunt-blühenden Pracht. Mutter Stina saß allein mit ihrem Strickzeug, und über dem alten Gesicht lag es fast wie Kirchhofsruhe. — Sie fragte auch nichts. Sie ließ ihn still da sitzen und vor sich hin sehn. Dann ging sie in die Küche und holte ihm zu essen. Und als es dunkel wurde, ging er wieder nach Hause, und sie wagten ihn dort alle nicht zu fragen, wo er gewesen war. * * * Und nun kamen böse Tage für Lars Asmussen. Alles Ding war zwecklos und hatte seinen Sinn verloren, und nur der scharfe Schmerz von den harten, lauten Stimmen weckte ihn hier und da zur Wirklichkeit. Und alle Arbeit, die mit Unlust und halber Kraft getan ist, bringt kein Glück. So ging es in diesen Wochen rückwärts mit den Asmussens. Manchmal wollte Lars sich aufraffen. Dann dachte er an Karen. Er meinte immer, sie müsse ihm zum Rechten helfen können. Und dann suchte er sie zu treffen. Aber Karen wich ihm aus seit der Stunde im Walde. Und wenn sie einmal zusammentrafen, war ihm, als tue er eine Sünde, und er schämte sich hinterher vor Trina, und ihr Lachen reizte ihn nur noch mehr. So kam es, daß, wenn Lars und Karen zusammen waren, sie nichts davon hatten, sondern etwas Verstecktes, Unnatürliches zwischen ihnen lag, und sie es beide empfanden wie einen Schmerz. Aber doch lebte Lars nur
  • 60. für die kurzen, flüchtigen Augenblicke. Karen aber trachtete heimlich, eine andere Stelle anzunehmen. Doch sie wußte, daß Frau Lind sie nicht hergeben wollte. Sie ging ihr im Haushalte zur Hand, aber vor allem war sie ihr bei den Kindern unentbehrlich geworden; denn Jakob Lind hatte sich allmählich ein großes Gartenland zusammengekauft, und Frau Lind hatte viel zu tun. Die vier kleinen Kinder aber hingen an Karen. Und Karen waren sie ans Herz gewachsen, daß sie sich auch nicht schnell zum Scheiden entschließen konnte. So zogen sich die trübseligen, unfruchtbaren Wintertage hin. Wo im Walde ein krankes Stück sich verbirgt, da stürzen sich die starken und gesunden darauf und forkeln[6] es zu Tode. Und die Menschenherde ist nicht besser als das Wild. — Die Männer witterten es, wie die Tiere wittern, daß etwas Krankes am starken, klugen Lars Asmussen war. Etwas, das nicht mitklang bei ihren Scherzen und das sich zusammenzog, wenn sie darauf schlugen. Eben eine Schwäche war da. Und darum schlugen sie darauf. Und wenn einer schlug, so schlugen sie alle. Sie dachten nicht darüber nach. Sie hatten nur Lust, so zu tun. Aber es war noch eins, das traf ihn empfindlicher als das andere alles. Peter hatte sich gegen ihn gekehrt. Lars’ lässiges Arbeiten hemmte auch ihn. Und er hatte keine Geduld mit seiner unlustigen Art. — Auch schämte er sich seiner Schwester. Ihre ganze Art mit dem sinnlos dummen Lachen lag auf Peter wie eine Schande. Und er war hart gegen Trina Asmussen, wenn er sie traf. Und Peters unfreundliches Wesen verschüchterte sie ganz. — Daß ihre Art auf Lars lastete und ihn hemmte, empfand Peter wohl, und er wäre Lars gern aus dem Wege gegangen deshalb. Stunde um Stunde aber band sie die Arbeit zusammen auf dem einsamen Meer. Und da wurde er hart gegen Lars und fuhr ihn zornig an, weil Lars ihm war wie ein Vorwurf, und er sich nicht zu helfen wußte in seinem Unbehagen. — Daß Lars es jetzt mit so vielen hielt, war ihm immer zuwider gewesen. Aber heimlich war er doch stolz darauf, daß die Männer ringsum auf Lars’ Worte hörten und zu ihm aufsahen. Da sie
  • 61. aber von ihm ließen und mit harten Worten nach ihm warfen, da fühlte Peter, daß Lars im Unrecht gewesen war, und in seinem Zorn und in seiner Härte hatte er etwas Verächtliches gegen ihn. Und es kam ein böser Wintersonntag, an dem der eisig feuchte Wind und die endlos kalte Öde den Menschen bis tief in die Brust hineinlangten und das bißchen Lust und Hoffnung herauszerrten und hinstreuten über das weite, graue Meer. Lars ging allein am Strande entlang nach Wanbyll, und wieder sagte irgend etwas in ihm: „Ich k a n n nicht“. Aber diesmal sagte er es nicht laut; denn seine Lippen waren aufeinandergepreßt, und der harte Zug saß fest um den Mund. Der rote Trollsen wagte sich am kecksten an ihn heran und spöttelte offen über den Spaßverderber. Einige von den Männern um den rohen Holztisch zogen den Mund breit und sahen sich an. Da lachte Lars hart auf und stürzte ein Glas Grog hinunter. Es war kalt, und das heiße, betäubende Prickeln tat ihm wohl. Da forderte er ein zweites und ein drittes, und es war, als versinke das finstere Elend um ihn her, und ein wohliges Vergessen käme über ihn. Da lachte er wild auf und forderte immer mehr. Und er hörte es erst am nächsten Tage, daß er zu Hause geschleppt worden sei. [6] Mit dem Geweih stoßen.
  • 62. Kapitel XXV Trina hatte manchmal Näharbeiten übernommen. Sie hatte das Nähen bei Frau Asmussen gut gelernt. Jetzt hatte sie es wieder aufgenommen. Mit ihrer Hände Arbeit schaffte sie manches für Lars heran, was ihm sonst gefehlt hätte. Denn in dieser Zeit tat es not, daß noch etwas Geld verdient wurde. Auch die Linds gaben ihr manchmal etwas zu tun. Karen hatte die Arbeit öfter zu ihr hingetragen. Aber jetzt ging sie nur zu der Zeit, wenn die Fischer auf See waren. Es war ein früher Märztag. In der Luft lag das Geheimnis. — Kahle Zweige ragten in die graue Luft, und öde, graue Flächen dehnten sich über die Koppeln. Und doch lag das Geheimnis in der Luft. Ein weiches Flügeln und Streicheln huschte über die Dinge und tastete sich bis in die Menschenherzen hinein. Und die Lerchen trieb es hinauf — hinauf und drängte und weitete die kleine Brust, daß sie sich Luft schaffen mußten in zwitscherndem Gejubel und die Flügel regten im Takt, immer hinauf in das weiche Grau. Denn die Lerchen glaubten an das Licht hinter den Wolken. — Oben auf der Koppel, von wo der freie Blick über das Wasser geht, stand Karen und horchte hinauf nach den Lerchen. Ihre hohe, schlanke Gestalt stand dunkel vor der Luft, aber es war etwas Helles auf ihrer Stirn. Karen war aufrecht ihres Weges gegangen, und keiner hatte über sie zu klagen gehabt. Da war nichts Zerdrücktes, Schwächliches an
  • 63. ihr. Ihre Last hob sie auf und deckte sie sorglich mit ihrem Stolze zu und ging damit vorwärts mit gehobenem Haupt. Aber das Weiche, Tastende in der Luft hemmte ihr frisches Vorwärtsschreiten, daß sie sinnend einhalten mußte und hinaufhorchen nach den Lerchen und in sich hinein. Und die Gedanken stiegen auf und lagen auf ihrer Stirn, daß sie die Brauen zusammenzog über den hellen Augen und langsam weiterging, den Blick am steinigen Wege. Sie konnte und konnte es nicht verstehn. Warum saß diese Liebe ihr so grundtief im Herzen, daß sie sich selbst nicht denken konnte ohne diese Liebe? — Es hatte doch alles Ding einen Sinn im wundersamen Weltgefüge. Wo war er hier? Warum konnte sie nicht einen andern lieben? — Es gab tüchtige, starke Männer genug um sie her, und sie hätten die Arme weit aufgemacht für dies stolze, frische, junge Leben. Dann wäre sie reich geworden. Eigenes, zartes, junges Sein hätte sie an der Brust gewiegt. Und wie Siegesstolz wäre des Weibes höchste Lust ihr aufgegangen, wenn rote Kinderlippen sie Mutter nannten. Aber es hätte alles angefangen mit einer großen Lüge. Sich ohne Liebe zu geben, dazu sagte ihr ganzes Wesen „Nein“. Und ihre Liebe wohnte bei dem einen, für den sie zwecklos war in dieser rätselvollen Welt. Und Karen setzte die Füße fest auf, als wollte sie die grübelnden Gedanken unter sich treten. Da sah sie die Fischerhäuser vor sich liegen, und sie atmete tief auf. Sie mußte irgendwo zugreifen — vielleicht daß sie ihm helfen könnte durch die Frau. Sie mußte eben aufhorchen und achten, wenn der Augenblick kam, daß diese stumme Liebe zur Tat werden konnte. Da stand sie vor dem Hause und schob die Gartentür auf. Mutter Lassens laute Stimme fiel ihr schrill entgegen, daß sie zurückstutzte. Denn dieses Volk zwischen den großen, stillen Weiten hat oft einen Abscheu vor dem Lauten und Rohen. Und Karen war auf einem einsamen Hofe ausgewachsen zwischen schweigsamen Leuten. Dann trat sie rasch über die Schwelle, aber in ihrer Art war etwas
  • 64. Gezwungenes. Und wie sie Trina ansprach, fühlte die es gleich, und das laute, breite Lachen grüßte Karen wie ein Schlag. Da ging es wie ein kühler Hauch über ihr Wesen, und im harten Kampf gegen ihre Art bekamen die klaren, hellen Augen fast etwas Hochmütiges. Das verwirrte Trina nur mehr, daß sie nicht verstand, was Karen von ihr wollte, und ihre Art immer unsicherer und alberner wurde. Und dazwischen kam immer wieder das laute Lachen und breitete Trinas Gesicht, bis das Rohe es fast unkenntlich machte. Es war Karen fast unheimlich, mit ihr zu reden, und sie wandte sich an Mutter Lassen mit ihrem Auftrage. Die stemmte die Arme ein und kam diensteifrig heran, und ihr Gesicht legte sie in würdige Falten. Aber der Gedanke, daß diese zwei zu Lars gehörten, stieg in Karen auf wie ein zorniger Widerwillen. Mutter Lassens schwatzender Bereitwilligkeit antwortete sie mit knappen Worten, und in den Worten und den hellen Augen lag es immer wie Hochmut. Dann wandte sie sich nach der Tür, und ihr Abschied von den beiden war wie eine Flucht. Sie ging langsam über die Koppeln hinauf; denn seit dem Tode der Eltern hatte noch niemals so schwere Last auf ihr geruht wie heute. Und bei jedem Schritt stieg deutlicher das Bewußtsein von ihrer eigenen hochmütigen Kälte in ihr auf. Es war fast unerträglich, diese wachsende Scham. Und all das ahnungsjunge Frühlingshoffen von vorhin ward daneben wie ein lächerlicher Hohn. Sie kam am Waldesrand entlang. — Und tief aus den kahlen, dämmerigen Tiefen zog ein Klingen hinaus in die weiche, graue Luft. Es legte sich um das Menschenherz wie unsagbares Sehnen nach unerreichbarem Licht, und wieder wie ein zartes wachsendes Hoffen auf wunderlich-rätselvoll Verborgenes, ein Aufquellen aus geheimnisvollen Gründen, ein jauchzendes Erschauen und dann ein zart verklingendes, ahnungsvolles Hoffen. Es war die erste Drossel, die Karen in diesem grauen Vorfrühling sang. Und sie legte die Hand über die Augen, und ihre Seele ging
  • 65. langsam Schritt um Schritt aus ihrer eigenen Unrast hin zu der hellen, rauschenden Quelle, aus der sie sich schon so oftmals junge, freie Kraft geschöpft hatte. Im Flecken traf sie Jakob Lind. Der hatte gehört, daß Lars in den letzten Wochen oft betrunken gewesen war. Aber sie sprachen nicht über das, was sie drückte, diese beiden. — Jakob Lind und Karen gingen schweigsam den Weg nach Aalby nach Hause. Und das weiche, tastende Geheimnis aus der grauen Luft strich ihnen leise über die ernsten Stirnen. Karen versuchte es noch ein paarmal, wenn Frau Lind Näharbeit zu Trina Asmussen besorgt haben wollte. Es gelang ihr auch wohl, daß die kühle, fast hochmütige Art aus ihrem Wesen fern blieb. Aber sie kam darum doch nicht viel weiter mit Klein-Trina, und sie fühlte wohl, daß noch etwas wie ein Widerwillen in ihrem Herzen saß gegen die arme Kranke.
  • 66. Kapitel XXVI Jakob Lind konnte Lars’ nicht habhaft werden. Er ging ihm nun schon seit vielen Wochen mit finsterm Gesicht aus dem Wege. Da kam ein Tag, an dem sich Peter an der Hand verletzt hatte und ein paar Tage aussetzen mußte mit der Arbeit. Jakob Lind hatte davon gehört, und er ging nach Mutter Stinas Strohdachhaus, und in seinem Kopf steckte ein Plan. Die beiden Fischer saßen dort auf ihren alten Plätzen. Aber ihre ärgerlich-harten Stimmen klangen ungewohnt unter dem niedrigen Dach hervor. Sie saßen mit den Mützen in die Stirn gerückt und sahen jeder in eine Ecke, und über Mutter Stinas stillem Gesicht lag der Kummer wie eine schwere Last und hatte mit harter Schrift unzählig tiefe Linien hineingegraben. Sie rührten sich alle kaum, als Jakob Lind eintrat, und grüßten ihn nur mit den Augen. — Er fragte nach Peters Hand, und wen Lars zum Ersatz in seinem Boot hätte heute nacht. Denn die Luft war milde und still und günstig zum Fischen. Lars gab eine mürrische Antwort, weil er niemand hatte, denn im Sommer arbeiteten die zwei andern nicht mit ihnen. Da blitzte es fast lustig auf in Jakobs Augen. „So nimm mich mit, Lars, ich möchte einmal helfen.“ Da sahen sie wirklich aus ihren Ecken heraus und sahen sich an, und beide Fischer lachten halblaut vor sich hin. „Das wird wohl schwer halten, Herr Lehrer,“ sagte Peter, und er hatte etwas Mitleidiges dabei.
  • 67. „Du kannst mich ja pullen lassen, Lars; das Auswerfen verstehe ich wohl nicht. Aber für einmal schaffe ich es wohl, mit dem Netz einziehn, wenn du mir’s zeigst. Und ich habe eben Lust dazu.“ Da sah ihn Lars sonderbar an und schwieg eine Weile. „Na, denn man zu, Jakob,“ sagte er endlich mit tiefer Stimme. „Peter borgt mir wohl sein Zeug,“ sagte Jakob Lind. „Es wird ein bißchen groß sein, Herr Lehrer.“ — Und in Peters Stimme saß ein verhaltenes Lachen. Es war eine von den wunderlichen, milden Nächten. Hier und da glitten die Wolken zur Seite, und durch graue Dünste goß der Mond ein zitterig rotes Scheinen über die Welt. Aus der frühlingsatmenden Erde stieg ein reiches, schweres Duften wie ein aufquellend- sehnendes Leben. — Aber rings in der lautlos samtweichen Dunkelheit lag es wie seltsam schlummernde Dinge, wartend, aus ihrem leisen Schlafe aufzustehn und in das rötliche Geschimmer hinzutreten. Merkwürdig laut klangen die Tritte der schweigsamen Männer auf den Brettern des Ricks. Und dann kam der Ton der Riemen in den Dollen und das leise, gleichmäßige Platschen. Das paßte sich hinein in das große Schweigen und ward selbst ein Klang der raunend- dunklen Heimlichkeit. Es dauerte eine lange Zeit, dies schweigende Hingleiten. Aber endlich seufzte Jakob auf und nahm seinen Blick von der breiten, glitzerigen Flimmerstraße über den Wellen fort. Eine Weile sah er auf die dunkle Gestalt an den Riemen und ihr gleichmäßig schweigendes Tun. — „Lars, es ist ja nur der eine Ruck, Mensch, daß du aus dir herauskommst, nachher ist dir leichter; das weißt du!“ „Es nützt doch nichts, Jakob. Es ist doch einmal alles verwirrt, am besten, man beißt die Zähne zusammen und schweigt.“ Und Lars sah wieder gerade vor sich hin. „Aus dem Ärgsten hast du dich schon herausgewühlt, Lars, ich weiß es. Seit fast zwei Monaten warst du nicht im Wirtshaus. Du bist
  • 68. schon den ersten Schritt den neuen höheren Berg hinauf. Warum redest du denn davon, daß es alles nichts nützt?“ „Weil ich nicht mehr an den Berg glauben kann, Jakob Lind. Es ist ein ewiges Auf und Ab, weiter nichts!“ Die Stimme klang, als wenn er aufschrie in seiner Not. „Seit wann ist denn das so gekommen?“ „Das kann ich dir nicht so sagen, Jakob,“ stockend und stoßweise sprach er. „Ich habe eben mit einmal gemerkt, daß ich es alles verpfuscht habe in meinem Leben, und ich hab’ doch eigentlich immer vorwärts und hinauf gewollt, und wenn das denn doch so zugelassen wird, dann ist da ja wohl auch alles tot und still hinter der Welt. Großvater hat sich das alles so schön gedacht, aber das war wohl nur so ein Spielzeug von ihm, und nun ist er ebenso tot wie ein Hering oder wie die Mücken von gestern.“ Da waren sie lange still. Dann seufzte Jakob noch einmal auf und richtete sich ein wenig hoch, wie mit einem Entschlusse. „Und die Liebe Lars? — Meinst du, wir wüßten nun nicht endlich, warum Karen nicht heiratet? So eine große, stille Liebe die gar nichts will und doch festhält, ist die auch nur in die Welt hineingehagelt ganz zweck- und sinnlos?“ „Das weiß ich nicht, Jakob.“ Und wieder klang das leise, gleichmäßige Patschen. Und der Mond war verschwunden, und unter dem Uferschatten lag die weiche, unheimliche Finsternis. — Da fing er wieder an mit der sonderbaren Stimme, in der die Not hindurchzitterte. „W e n n es nur etwas gäbe, Jakob, irgendein Festes, an dem man es greifen könnte. Wenn ich alles Helle in meinem Leben verpfuscht und vertrieben habe, meinetwegen. Aber, daß man andere unter Wasser zieht, daß ich den Leuten nicht mehr helfen kann und dann“ — Lars stockte und zog die Riemen ein und lehnte sich schwer darauf.
  • 69. Da beugte sich Jakob ganz vor. „Mensch! Lars, dir ist Kraft gegeben über die Menschen bei all deiner träumenden Langsamkeit. Pack’ zu! Schaff’ dir wieder Mut!“ „Ich kann nicht, Jakob, wenn ich denke, es hat alles keinen Zweck, da ist kein Berg, auf den es sich lohnt, daß ich mich und sie hinaufschleppe. — Es müßte da e i n Festes sein in dem großen Tüter. Weißt du eins, an dem man es sieht, daß da eine Ordnung ist in dem Ganzen und ein Wille dahinter. — Früher, da dachte ich, der Jesus Christus mit seiner stillen, sicheren Art. Der sagt, daß er von Gott kommt, und dem kann man es glauben, wenn er sagt, daß er Gott gesehen hat. — Aber da hab’ ich ein Buch gelesen, da war das alles klipp und klar bewiesen, daß er sich geirrt hatte und nur ein ganz gewöhnlicher Mensch war, so ehrlich und treu er auch sonst sein mochte. Und der Gott, an den er so fest glaubte, soll ihn im Stich gelassen haben, und mit dem Schrei ist er auch gestorben. — Na, wenn der sich geirrt hat, dann ist ja doch auch nichts hinter der wirren Welt, und es ist eben alles gleich.“ „Lars, das läßt sich nicht so ausrechnen, wie die da in dem Buch geschrieben haben. Wir wissen nur so viel, daß sein bester Freund, der Tag um Tag mit ihm war, gesagt hat, er war ohne Sünde. Und das hat auch der allerbeste Freund noch von keinem Menschen sonst behaupten können. Und sieh mal, Lars, wenn dieser Mensch ohne Sünde sagt: ‚Wer ihn ansieht, der sieht Gott‘ und er ruft die ganze, große Menschheit zu sich und will sie allein zu Gott hinführen, dann muß er wohl wissen, wovon er redet.“ „Du magst ja vielleicht auch recht haben, Jakob, das ist dann doch auch wohl wieder so ausgeklügelt wie in dem Buch, nur anders herum. So recht verstehen wie ihr, die ihr euer ganzes Leben daran herum denkt, können wir einfachen Leute das ja nicht. Aber zum Weiterkommen hilft das Überlegen wohl nichts.“ „Nein, da hast du ganz recht, Lars. Ich glaube, du mußt dir mal Mutter Stinas Bibel herunter holen und die alten Geschichten ganz still für dich allein durchlesen, und dann einfach drauflos leben, so wie du fühlst, daß es recht ist für dich. Aber dann mußt du
  • 70. manchmal die Ohren aufmachen und in dich hineinhorchen und um dich in die wunderliche Welt. Da klingt sie schon herauf, die große Wahrheit aus der Tiefe. Weißt du, wir Männer sind mehr zum Anpacken und Vorwärtsschieben gemacht, glaube ich. Aber die Frauen, die sitzen noch näher an der großen Ordnung fest, von der Klaas Klaaßen immer sprach. Die hören die Stimmen aus den heimlichen Tiefen viel lauter. Ich glaube, die können uns helfen darin!“ — Dann war Jakob still und wartete. Aber Lars hatte die Tür seiner Seele wieder zugeschlossen. Er schämte sich, daß er so viel gesagt hatte. Und Jakobs Reden wollte er gern unterbrechen. Darum gab er ihm die Riemen und fing an, das Netz auszuwerfen. Jakob fühlte, daß er genug gesagt hatte, und er trachtete nur noch, wie er Lars bei der Arbeit helfen könnte. Und die große, stille Nacht war um die schweigenden Männer. Und leise gluckste das Wasser, und patschend tropfte es vom Netz und glitzerte im rötlichen Mondlicht. Und weit draußen tauchten ein paar dunkle rundlich-breite Körper aus dem Wasser und versanken wieder, um weiterhin herauszuschnellen, mitten in der flimmerigen Mondesstraße. „Sieh da, Tümmler,“ sagte Lars. Dann war es wieder still und einsam. * * * Es war an einem Sonnabend, als Lars und Peter die Fische nach der Räucherei brachten, daß Trina groß Reinemachen hatte. Es ging ihr viel besser, und Mutter Lassen hütete jetzt oft tagelang ihren Enkel in Peters Haus oder bei ihrer andern Tochter. Die Fenster standen weit offen, und die weißen Gardinen bauschten sich im warmen, salzkräftigen Sommerwind. Ein starkes Duften trug er von den Jasminbüschen bis in die Stube hinein, und von Zeit zu Zeit summte eine Biene am Fenster vorbei.
  • 71. Trina saß vor dem Tisch und räumte die Schublade auf, und der Wind hatte ihr ein paar Haarsträhnen über die Stirn geweht. Ihre Backen waren heiß, und sie glich wieder mehr Klein-Trina von früher. Da klang ein leichter, fester Tritt vor dem Fenster. Karen trug ein Bündel im Arm, und es war, als brächten die hellen Haare und die hellen Augen noch mehr Licht in die Stube. Trina war so ganz bei der Arbeit, daß sie das Lachen vergaß, und Karen konnte ungestört ihr Bündel aufknoten. Als sie ihr die Arbeit erklärt hatte, setzte sich Karen ans Fenster und rief Klein-Klaus heran. Er spielte vor der Tür und kam langsam Schritt vor Schritt näher, und seine prüfenden Augen ruhten ernst auf der Fremden. Aber das helle Kleid, auf dem der breite Sonnenschein lag, und die lachend klaren Augen gefielen ihm, und er stellte sich zu ihr. Trina freute sich, daß er einmal artig war, und sie sah schnell von ihrem Räumen auf. Es war, als hätte der warme, sonnige Wind die Schwere zur Seite geblasen, die sonst in dem Zimmer zu lasten schien. Es wurde Karen heute fast leicht mit Trina zu reden. Sie hatte eben eine Frage wegen Peters Kindern gestellt, da blieb Trinas Blick auf einem Stück Papier haften, und sie gab ihr keine Antwort mehr. Karen sah erstaunt auf Trina hin; aber sie starrte immer auf den Brief. Und jetzt sah sie, wie sich Trinas Schultern hoben, wie in unterdrücktem Schluchzen. Es ging wie eine Blässe über ihr Gesicht und wie etwas Gequältes. Da schob Karen den Jungen fort und zog ihren Stuhl zu Trina hinüber. „Was ist es, Frau Asmussen, vielleicht kann ich helfen,“ sagte sie schnell und legte ihre Hand auf Trinas Arm. Aber Trina rückte ängstlich zur Seite. „Nein, nein,“ sagte sie hastig und deckte die Hand über das Papier. Aber große Tränen waren in ihre Augen getreten, und sie sah Karen schnell ins Gesicht wie mit einer quälenden Frage. Aber Karen scheute sich, weiter zu drängen, und sah fast hilflos auf Trina.
  • 72. Da legte die mit eins die Arme auf den Tisch und grub das Gesicht in die Arme und ihr ganzer Körper bebte in heftigem Weinen. Das ging Karen ins Herz, und sie legte den Arm um ihre Schulter. „Ich kann’s gewiß hören, Trina,“ bat sie. Trina weinte laut auf und, ohne den Kopf zu heben, schob sie ihr das weiße Blatt hin. „Ist das wahr, o ist das wahr?“ schluchzte sie. Auf dem Blatt stand ein kurzer ärztlicher Bericht über Trinas Befinden und die Angabe der Zeit für ihre Rückkehr. Und darüber gedruckt stand „Landesirrenanstalt“. — Nun wußte Trina, daß sie nicht im Diakonissenhaus gewesen war. — Karen strich ihr still über die Schultern. „Haben Sie’s gewußt?“ kam es endlich stoßweise zwischen dem Schluchzen hervor. „Ja, Klein-Trina.“ Und Karen streichelte sie. „Jetzt haben Sie Angst vor mir. — Und sie mögen mich alle nicht mehr. — Und oh, ich schäme mich so.“ Und Trina wühlte den Kopf noch tiefer, und das Schluchzen war herzbrechend. Da schmolz das Harte in Karens Brust, das die Tür gegen Trina Asmussen gesperrt hatte. Jetzt hatte sie vergessen, daß dies Lars’ Frau war. Es war nur eben Klein-Trina, ein Menschenkind in großer Not. Und sie redete ihr zu wie einem Kinde und tröstete sie, und daß die große, stolze Karen noch so zu ihr sein konnte, das half Trina aus ihrer ersten Not über die Schande, die auf ihr lag, heraus. — Aber darum war sie doch noch da, wenn Karen ihr auch über dies erste Erfahrene hinweggeholfen hatte. Und Trina schämte sich. — Und am allermeisten schämte sie sich vor Lars. — Aber von dem Tage an wußte Karen, daß sie getrost in die Zukunft hineingehen konnte. Sie hatte Klein-Trina lieb gewonnen.
  • 73. Kapitel XXVII Lars Asmussen und Jakob Lind hatten recht. Es sitzt eine heilende Kraft im Anpacken. Der Mensch treibt mit seiner frischen Tat den Nebel vor sich her, daß er nicht mehr vor seinen Augen liegt wie eine trübe Wand. Und während er noch mit aller Kraft bei seinem Werke ist, hat sich leise, leise der Nebel geteilt, und der erste keusche Sonnenstrahl tastet sich durch das trübe Grau. — Dann kommt wohl irgendeine treue Hand und rührt ihn an und sagt: „Da ist das Licht!“ Und er sieht auf und wagt fast noch nicht, sich zu freuen. Dann aber hebt er den Kopf in den Sonnenschein und zieht auf seiner eigenen Straße nach dem Ziel, das ihm in der großen Ordnung gesteckt ist. Und vielleicht ist es gar nicht fern. Aber das gilt ihm gleich, denn er sieht wieder, daß es auf einem hohen Berg gelegen ist und daß die Sonne scheint. Der arme, kleine Mensch — nicht einmal den Nebel kann er selbst vertreiben, um wieder seinen eigenen Weg in der großen Ordnung zu sehen! Nur tapfer handeln kann er, seiner Art getreu, und warten, bis der Nebel weicht. — Lars war zu einem Entschlusse gekommen. Nicht, daß ihm Jakobs Raten viel genützt hätte. — Guter Rat hat wohl noch keinen Mann aus dem Brunnen gezogen. Und gerade einem aus dem eigenwilligen nordischen Volke wäre es ein hartes Ringen gegen seine Art gewesen, auf fremdes Wort zu hören. — Nein, der Rat tut’s selten, aber die Liebe tut es. — Da ist es, als schlösse der andere
  • 74. Mensch ein Fenster in seiner Seele auf. Mancher tut’s schnell, als stieße er mit Kraft die beiden Flügel auf, der andere drückt und stemmt und bringt die rostigen Angeln nur mühsam auseinander. Aber wie es auch ist, und manchmal war es nur ein unbehilflich Wort — aber von da innen aus der verschlossenen Seelentiefe sehen dann so wunderlich strahlende Dinge hervor, die man nicht nennen kann und nicht ausrechnend wägen. Aber für kurze Augenblicke hat sie der in der großen Not gesehen, und ganz leise, wie von fern kommt es ihm wie Lerchenglaube, daß da Licht sein könnte hinter dem Nebel. — Lars hatte eins verstanden: Da war ein Mensch, der glaubte noch an ihn. Da wußte er, daß er wieder Mut fassen konnte, wenn er sich aufraffte. Und er schämte sich seiner Tatenlosigkeit. Er ging durch Haus und Gartenland und sah, daß überall Arbeit wartete. Und wie er erst anzupacken begann, begriff er nicht mehr, daß er es hatte so weit kommen lassen. Es war zurückgegangen in Lars’ Wirtschaft. Und nun faßte ihn die Arbeit wie ein Fieber. Peter wurde es fast zu viel, weil Lars Stunde um Stunde draußen bei der Arbeit bleiben wollte. Und wenn er dann vom Fischen kam, machte er sich an die Kartoffeln, und Trina half ihm tüchtig beim Ausmachen. Und er besserte und hämmerte überall. Und dann machte er sich mit dem Dachdecker daran und setzte ein neues Strohdach auf Mutter Stinas Haus. Er wurde mager in diesem Sommer über all dem harten Arbeiten; aber als der Herbst herankam, war fast alles wieder so gut imstande in den beiden Häusern und dem Gartenland wie sonst, und das viele Arbeiten hatte auch Trina gut getan, und sie war so gesund und ruhig, daß Mutter Lassen zu ihrer zweiten Tochter ziehen konnte, wo eben wieder ein Kind geboren war. In seinem Hause war es nun stiller und klarer geworden. Lars war kaum zum Nachdenken gekommen. Er wußte nicht recht, wie ihm selbst zumute war. Aber unbewußt war es auch klarer und ruhiger in ihm, und da war auch allmählich ein Entschluß gereift. Er wußte wohl, daß er die Unrast erst ganz los wurde, wenn er es sich
  • 75. ganz unmöglich machte, Karen wiederzusehen. Das wollte er ihr nun sagen. — Es mußte ein Abschluß gemacht sein. Es war ein warmer Sonntagnachmittag für den beginnenden Herbst. Lars ging nach Aalby. Als er in den Lehrergarten trat, sah er gleich, daß Karen hinten unter dem Apfelbaum stand. Die schweren Äste hatten viele Stützen, und doch bogen die rotbackigen Äpfel die Zweige fast bis zum saftiglangen Grase hinunter. Zwei hellhaarige, kleine Lehrerskinder standen neben Karen und hielten den großen Korb. Den kleinen Zweijährigen hob sie nach den bunten Äpfeln hinauf, und er patschte mit den dicken Armen in die vollen Äste hinein und riß von den lustigen Früchten herunter. Karen nahm sie ihm ab und warf sie in den Korb. Zwischen den Blättern aber lachten die hellen Sonnenlichter hindurch und schillerten auf all den hellhaarigen Köpfen und lagen wie goldene Flecke im schattig bläulichen Grase. Es war wie ein Zittern in der Luft von hellen, lachenden Kinderstimmen und warmen Sonnenlichtern. Als Karen die Schritte hörte und sich umsah, ging es wie ein ernster Schatten über die frohen Augen. — „Gleich,“ sagte sie, „wenn ich hier fertig bin, will ich mit Ihnen sprechen.“ Dann setzte sie das Kind zur Erde und zog ihm die kleine Schürze zurecht. Es wollte weinen, aber sie gab ihm einen bunten Apfel zum Spielen und faßte dann selbst in die roten Früchte hinein. Der Korb war bald gefüllt, und sie schickte die Kinder damit ins Haus. Dann setzte sie sich zu Lars auf die Bank unter dem Apfelbaum und hob den Zweijährigen auf ihren Schoß. Lars aber sah immer unverwandt mit dem ernsten Gesicht vor sich hin, so als merke er gar nichts von der lachenden, reifenden Fülle ringsum, sondern sähn nur tief in sich hinein auf einen steten, festen Punkt. „Nun?“ fragte Karen endlich und sah auf das Kind hinunter. „Ich habe mir das überlegt,“ sagte Lars, und er sprach es eintönig, wie eingelernt, vor sich hin. „Es ist besser, ich komme nicht mehr hierher. Ich wollte aber gern, daß Sie das wüßten. Und ich wollte Ihnen auch gern Lebewohl sagen — für immer“ — setzte er leiser hinzu.
  • 76. Sie hob den Kopf und sah ihn fest an. — „Das habe ich schon immer gedacht. Ich gehe auch zum ersten Januar nach Hamburg in eine andere Stellung. Sie brauchten aber gar nicht erst zu kommen, ich hätte das schon so gewußt, warum.“ „Vielleicht wollten Sie auch nichts mehr von mir wissen — jetzt!“ Es lag finster über seinem Gesicht und wie eine Bitte. Es war einen Augenblick still. Ein Apfel fiel mit dumpfem Klang ins Gras. Auf dem schmalen Fußsteig hüpfte eine Amsel mit ihren Jungen und fütterte sie aus einem alten Apfel. Karen zeigte sie dem Kinde, und es lachte und streckte die Arme nach den Vögeln. Da sah sie Lars wieder fest in die Augen. „Ich wußte, daß es nicht so bleiben würde, wie die Zeit im Winter. Ich wußte, daß Sie wieder zurecht kommen würden, Lars Asmussen.“ Die Sonne lag ihr wieder in den Augen. „Warum wußten Sie das?“ „Das weiß ich nicht, aber ich weiß auch, daß alles wieder ganz hell wird in Ihnen. Gott wird Sie noch brauchen, Lars Asmussen.“ Lars hatte die Ellbogen auf die Knie gestützt und sah tief ins lange Gras hinunter. „Wenn man aber nichts merkt und nichts fühlt.“ — Er stockte. „Sie fühlen es ja schon wieder, sonst wären Sie gar nicht so weit. Sie haben nur geschlafen bis jetzt.“ Sie war ganz rot geworden, solche Anstrengung war es ihr, so zu sprechen. Er sah sie wieder an. „Vielleicht ist es so. — Es muß wohl etwas sein“ — er sprach nicht fertig, sondern stand langsam auf. Sie stand auch vor ihm. Das Kind hatte sie auf die Erde gleiten lassen, und es trottete zu den kreischenden jungen Amseln hinüber. Einen Augenblick ging es wie eine heiße Welle über sein Gesicht. Aber sie sah ihm fest in die Augen und gab ihm die Hand. Da hielt er sie fest in seiner schweren Arbeitsfaust, dann drehte er sich um und ging hinaus, und sein Gesicht war so ruhig wie sonst.
  • 77. Auf den Koppeln stand fast überall das Korn in Hocken. Es knisterte förmlich in der warmen Sonne. Die Luft war sehr still. Hier und da schnarrte der metallene Grillenklang zwischen den glänzenden Stoppeln herauf. Lars stand und sah auf die strahlend weißen Wolken, wie sie hinter den Koppeln riesenhaft heraufwuchsen im tiefen Blau. Es war eine Stille in Lars Asmussen. Er hatte vor den großen Rätseln gestanden und in die unergründliche Nacht gesehen. Aber er hatte mit Taten auf das Dunkel losgeschlagen. Und nun begann es, sachte, ganz sachte zu tagen. Und in Lars’ Seele war es so, wie zu der feierlichen Stunde, wenn der ernste Morgenwind vom kommenden Lichte raunt. Die letzten Jahre hatten harte Linien in sein Gesicht gegraben. Aber er ging wieder wie sonst fest und aufrecht seiner Arbeit zu.
  • 78. Kapitel XXVIII Christen Matthies war der erste, der im alten Vertrauen mit Lars zu reden begann. Die andern beiden Männer behielten noch eine Weile ihre verächtliche Art mit ihm. Aber er kehrte sich nicht an sie. Er hatte ein paar große Aalkästen für die Räuchereien gezimmert und ein gutes Stück Geld damit verdient. So konnte er sein Land vergrößern. Auch brachte der Winterfang guten Verdienst. Was im Haus oder an den Booten zu machen war, zimmerte er alles selbst, so gab er weniger aus als die andern. Auch war Trina eine tüchtige Frau und hielt das Geld gut zusammen. Er hielt sich viel für sich in diesem Winter. Und Trina freute sich in ihrer stillen Art, daß er öfter bei ihr saß. Wenn er in der Arbeit absetzte, dann gönnte er sich wieder die alte Freude und saß hinter seinen Büchern. Er stützte dann wohl einmal die Ellbogen auf den Tisch und sann vor sich hin. Und ganz selten, wenn Trina fort war und Klaus in der Schule, holte er auch das dicke Bibelbuch aus der Schublade und saß und blätterte und sann. Und dann ging er wieder in seine Werkstatt im Schuppen hinter dem Hause und hämmerte und zimmerte und machte sich hier und da einen Nebenverdienst mit seinen geschickten Händen, daß sie zum Frühling endlich wieder Geld nach der Sparkasse bringen konnten. In dem Sommer schaffte Lars nicht mehr so fieberhaft wie im vorigen Jahr, aber er arbeitete mit ruhiger Stetigkeit. Das ruhelose Sehnen, das in ihm gewesen war, hatte ihn nun verlassen. Ganz tief unten im Grunde seines Herzens, dort, wo die
  • 79. stillumfriedete Stelle war, dort wohnte auch seine Liebe. Aber ebenso wie in seiner Knabenzeit, trat er dort selten ein. Wenn er einmal ganz einsam sonntägliche Stille um sich fühlte, dann legte sich, wie in alten Zeiten ein knabenhaft-ernster, fast finsterer Ausdruck über das braune Arbeitergesicht, in dem jetzt so viele harte Linien standen; dann war Lars in sein Heiligtum getreten. Aber es war nichts Finsteres, was er dort in der Stille fand. Da war Karens helles Bild, und da war Größeres als Karen. Aber einen tiefen Ernst brachte er doch immer von dort ins Leben zurück. In dem Ernst bekamen die Dinge um ihn her ein anderes Gewicht und Maß. Der Hohn oder die Achtung der andern kümmerten ihn nicht viel. Darum konnte er auch Peters und Kords scharfe, harte Reden ruhig anhören, ohne ihnen, wie sonst, mit bittern, zornigen Worten zu antworten. Seine fast gleichgültige Schweigsamkeit machte sie stutzig, besonders da bei seiner Arbeit nichts mehr von Gleichgültigkeit war. Da wurde ihnen die verächtliche Art, die sie noch immer mit Lars hatten, zuerst unbehaglich, und allmählich fielen sie unbewußt in ihren alten Ton von den früheren Jahren zurück. Die andern Männer, die mit ihnen zu tun hatten, empfanden die größere Achtung in ihrer Art, mit Lars zu reden, und nahmen denselben Ton an. Mit einem lecken Boot oder einem kaputten Fischkasten fing es an. Da durfte er wieder raten und helfen wie in alter Zeit. Und allmählich waren es größere Dinge als Boote und Fischkasten, wegen derer sie zu ihm kamen. Und ganz allmählich ließen sie es zu, daß sich die Erinnerung an Lars’ böse Zeit verwischte. Da merkte Lars, daß er sich doch noch freuen konnte. Und wie das lange, klare Sommerlicht wieder über dem stillen Wasser lag, da sah er mit festem, klarem Blick hinein. Und es war wie ein Widerschein des hellen Sommerlichts in seinen Augen, und wie er dastand, war es wie eine unerschütterliche Sicherheit über dem ganzen Manne. Er sprach jetzt noch seltener als sonst, und er ging auch seltener ins Wirtshaus. Aber gerade seine große
  • 80. Schweigsamkeit gewann ihm das Vertrauen der Leute noch schneller wieder. Der Sommer war schon vorbei und der Heringsfang sollte wieder beginnen. Da war es an einem Abend, an dem das Sägen und Hämmern unten am Strande wieder in die große Stille hinausklang, daß Kords zu Lars herangegangen kam. Seine Hände staken in den Hosentaschen, und seine niedere Stirn sah noch finsterer aus als sonst. Lars sah nicht auf von der Arbeit. „Naa?“ fragte er, als sich Kords neben ihn stellte. „Naa,“ sagte Kords, „wer soll das Boot haben?“ „Hinrichsen,“ sagte Lars. „So’n Ding kriegt leicht ein Leck,“ sagte Kords. „Warum?“ brummte Lars und hämmerte dröhnend auf die Planken. „Naa, wenn man das rammt, so hier mit dem Vordersteven in die Breitseite!“ Er fuhr mit der Hand an den Planken entlang und wischte dann mit der knotigen, großen Faust durch sein Gesicht und schnaufte dabei ein wenig verächtlich. Lars tat noch ein paar Hammerschläge, dann richtete er sich auf und sah Kords an. „Was ist eigentlich los?“ fragte er. „Das habe ich gestern ausprobiert, was so’n Boot aushält, an dem da von dem verfluchten Kerl!“ „Was für’n Kerl, nun erzähl’ vernünftig oder laß mich bei der Arbeit!“ „Na, weißt du noch, von dem, der mich dazumal mit dem Stein geschmissen hat?“ „Na, das ist wohl öfter bei dir vorgekommen!“ Kords stand da, groß und dunkel gegen die helle See, und als stäken die überkräftigen, verarbeiteten Glieder überall zu groß aus
  • 81. seinen Kleidern hervor. Es war nichts von Spaß an ihm, nur etwas Mißmutiges, und eine ernste Wirklichkeit sah aus seinen tiefliegenden, kleinen Augen heraus. Als Lars ihn ansah, stellte er Hammer und Säge zur Seite und setzte sich auf den Bootrand. „Naa?“ fragte er noch einmal ernster. Fast zornig, als rede er wider seinen Willen, und ruckweise fing Kords an: „Du weißt doch, dazumal in der Stadt, als ich nicht streiten wollte und mir der Kerl den Kopf halb einschmiß? Na, den Kerl kriegte ich dazumal doch nicht zu packen. Aber denken konnte ich mir, wer’s war. Da war so’n junger, bummliger Lump, der konnte mich nicht leiden und soll nachher auch so ein paar Redensarten gemacht haben, daß man ganz gut merken konnte, der war’s! Na, der verfluchte Kerl ist nach Seegaade gezogen und fischt mit so ’nem andern Kumpan da draußen. Laß ihn, hab’ ich mir gedacht, wenn ich mir auch nichts Schöneres hätte denken können, als dem was verwischen! Nu fängt das Untier aber an, wenn draußen zu tolle See steht, und kommt hier in die Bucht. Ich das merken, und sobald draußen Sturm steht, leg’ ich mich mit meinem Boot hin und laure. Ich sage dir, Lars, auf hundert Meilen kenn’ ich das Boot! Wenn nun der Kerl um die Landspitze kreuzt, und ich merke schon, da und dahin geht der Kurs, dann lauf’ ich vor, werf’ Anker aus und fang’ an zu fischen, und er kann abziehen und einen andern Platz suchen. Und wenn ich dann merke, er hält Kurs auf einen guten Fischplatz, laufe ich noch mal vor.“ Kords lachte rauh und schlug mit der Faust aufs Knie. „Na, gestern war das denn auch so. Du weißt ja, jetzt im Sommer habe ich doch meinen großen Jungen mit im Boot. — Wie wir den fremden Kerl wieder reinlaufen sehen, gehen wir schnell Anker hoch und laufen ihm vor. Zweimal machten wir das, da wird er wild, kommt auf uns losgekreuzt, und wie er nah genug ist, fängt er ganz elend an zu fluchen. Na so was kann ich nicht so gut vertragen von so einem. — Du weißt ja, was das für ein Nordweststurm war gestern. Der Junge reißt das Segel hoch, und ich lege das Ruder um, so daß wir mit toller Fahrt losgehn, und eh’ der Kerl merkt, was ich will, habe ich ihn Steuerbord gerammt. Ich sage dir, Lars, der und
  • 82. sein Freund, die mußten schöpfen, daß sie trocken ans Land kamen, und meinem Boot hat’s kaum was gemacht!“ Kords lachte wieder fast roh heraus. Aber Lars sah immer ganz gerade vor sich hin. „Du mußt ihm Geld geben, daß er dich nicht verklagt,“ sagte er nach einer Weile bedächtig. „Das tu ich nicht, ich wollte, er wäre ganz ersoffen!“ „Dann wirst du wohl ins Gefängnis kommen, denn der andere Mann kann ja bezeugen, daß du’s vorsätzlich tatest.“ Aber Kords stand finster da in der Dämmerung und sah nach der andern Seite. „Dann verklag’ ich ihn wegen Mordversuchs.“ „Aber du hast keine Zeugen.“ „Wer weiß, ob ich nicht doch noch jemand auftreibe, der ihn durch den Hinterhof rennen sah.“ „Na,“ sagte Lars nachdenklich, „ich will’s denn mal versuchen, wenn man ihm mit den alten Geschichten droht, vielleicht hält er reinen Mund über diese Sache. Meinetwegen mag er mir sein kaputtes Ding bringen. Ich werd’s flicken.“ „Schön Dank!“ sagte Kords. Und am nächsten Sonnabend segelte Lars hinaus und brachte die Sache in Ordnung. Aber die Geschichte wurde doch unter den Fischern bekannt, und an den nächsten Sonntagen im Wirtshaus sprachen sie leise darüber. Und sie fluchten auf die Fischer von draußen, daß sie nun auch noch anfingen, bei schlechtem Wetter an ihren Fischplätzen in der Bucht zu fischen. Und alle freuten sich, daß Kords es dem von draußen gegeben hatte. Über Lars aber nickten sie wohlgefällig mit dem Kopf, weil er die Angelegenheit wieder zurechtgebracht hatte.
  • 83. Da dauerte es nicht lange, daß er ihnen klar gemacht hatte, wie not es tat, mit denen draußen zusammenzuhalten und feste Gesetze über die Fischplätze und die Stellnetze zu machen. „Seht, wenn wir an Tagen, wo für draußen allzuviel See steht, feste Plätze für sie hier bei uns frei halten, werden die sich vielleicht drauf einlassen, die Stellnetze nicht so weit vor die Bucht zu setzen.“ „Recht hast du wohl, Lars Asmussen,“ sagte Christen Matthies langsam. „Aber wenn wir so eine Vereinigung gründen, kommt uns da nicht die Regierung herein, und wir dürfen nicht mehr denken und sagen, was wir wollen?“ Lars lachte still in sich herein. „Da sei ganz ruhig, Christen, du kannst meinetwegen in deinem Herzen auf gammel Danmark schwören. Wir wollen bloß zusammenhalten, damit jeder gerade sein kann, wie er will, und uns keiner hereinredet.“ „Fein wäre das,“ schrie Kords auf einmal und haute mit der Faust auf den Tisch. — Und die andern um den Tisch nickten ernsthaft mit dem Kopf, und allmählich gingen sie alle darauf ein. Und da im Tabaksdunst der Wirtsstube taten sich die ersten zusammen. Zuhause mit Peter hatte Lars noch länger zu reden, eh’ er bereit war, mitzumachen. Dora hatte das Gute viel schneller gefaßt. „Warum denn n u r die Fischer, Lars, die Arbeiter auf dem Lande brauchen auch so was. Laß sie auch mitkommen, und dann können sie untereinander auch für ihre eigenen Kranken und die Waisen sorgen.“ Da sah Lars sie ernst an. „Vielleicht kommt das mal so, Dora.“ Dora brachte auch Peter allmählich so weit, daß er nachgab. Es dauerte nicht so sehr lange, da war die Vereinigung zustande gekommen; denn sie sahen fast alle ein, daß es not tat. Und als es ihnen Lars recht vorgestellt hatte, gingen sie immer mehr mit dem Gedanken um, einen eigenen kleinen Dampfer zu kaufen, der die Fische direkt zum Markt brächte. „Und dann gehört noch dazu, daß wir einen Händler hätten, der zu unserm Verein
  • 84. gehörte, damit die Fischpreise von uns aus bestimmt werden und die Arbeit zu ihrem Rechte kommt,“ sagte Lars. Dazu schüttelten aber viele die Köpfe und meinten, daß es sich nicht machen lassen werde. — Und als das Jahr herum war, da hatte es sich gezeigt, daß die neue Fischervereinigung gute Geschäfte machte. Die Fische kamen frisch und gut mit dem Dampfer zur Stadt. — Und weil sie alle zusammenhielten, konnten die Händler nicht viel gegen sie machen; auch hörten sie, daß die Rede unter den Fischern ging, eigene Händler anzustellen. Es war vorgekommen, daß einige von den Fischern auch in der Schonzeit Heringe fischten, auch waren die Maschen der Netze bei vielen unvorschriftsmäßig eng. Es war aber sehr selten vorgekommen, daß der Fischmeister in dieser Bucht nachgesehen hatte. Darum setzten sich die Fischer zusammen und machten eigene Gesetze und schrieben ihre Anliegen nieder und wählten unter sich sichere Männer und schickten die zur Stadt, damit das Ganze von der Regierung bestätigt werde. Sie erreichten auch, was sie wollten, und die Fischer waren zufrieden. Der erste dieser sicheren Männer, den sie wählten, war Lars Asmussen gewesen. Auch Peter Lassen war dabei und einige von draußen. Und nun kam es ganz von selbst, daß sie anfingen, diese Männer wie Führer anzusehn. Als immer mehr Fischer der Vereinigung beitraten, da versuchten einige Krakehler von Wanbyll, Macht über sie zu gewinnen. Aber sie ließen sich nicht hereinreden und kamen nur überein, daß sie unter sich Geld zurücklegen wollten für Notfälle. Und wieder war es Lars, der alles deswegen ordnen mußte.
  • 85. Kapitel XXIX Lars hatte sich noch ein Stück niederes Uferland gekauft, auf das bei Wind viel Seetang getrieben wurde. Wenn Lars nicht Zeit hatte, dann stand Trina mit ihrem Jungen, und sie harkten das Seegras herein, und sie trockneten es und hatten noch einen guten Verdienst mit dem Verkauf. Und Peter wußte, daß Lars immer mehr Geld auf die Sparkasse brachte, und daß er es zu etwas gebracht hatte in den letzten zwei Jahren. Auch sah er, wie sich die Leute von Lars führen ließen und daß es doch Hand und Fuß hatte, was er riet. Da wachte auch die alte Anhänglichkeit wieder auf, und er fing wieder an, zu Lars aufzusehn. Und hinter Lars’ Rücken rühmte er ihn vor den Leuten und machte ihnen klar, was Lars wolle, und kämpfte für seine Pläne. Und Peter kamen die Worte leichter als Lars, daß er manch einen gewann. Sie erreichten es auch, daß der Fischdampfer nicht von dänischem Gelde gekauft wurde. Das meiste hatten die Fischer selbst bestritten, und es hatte viel Geld gekostet. Peter und Dora hätten gern gewußt, wieviel Lars dazugegeben hatte, aber sie bekamen es nicht heraus. Es mußte viel gewesen sein, meinten sie, weil er wieder so hart an der Arbeit war. „Das ist ja gar kein Leben,“ sagte Peter und stand mit den Händen in den Hosentaschen dabei. „Man will doch einmal absetzen und w i s s e n, daß man lebt.“
  • 86. Aber Lars sah gar nicht auf, sondern hob den Ballen Seegras und trug ihn fort. Dann kam er zurück. „Sieh, Peter, wenn du mir mal hilfst, will ich hier einen Damm ziehen, damit mir die See nicht jedes Jahr über dies Land spült; dann kann das mal eine gute Wiese werden. Ein paar Kühe können wir uns dann vielleicht auch noch kaufen.“ — Peter schüttelte den Kopf, aber er faßte an und half das trockne Seegras hereinschaffen. Peter aber konnte nicht wissen, wann Lars „lebte“. Wenn er sich freute, dann schwieg er gerade so, wie wenn er litt. Aber doch wußte Lars jetzt, daß er lebte. * * * Es war ein warmer Frühlingsmorgen. Der Regen hatte alles reingewaschen, nun kam der weiche, starke Wind vom Meer und streichelte mit dem Sonnenschein um die Wette an den jungen, feinen Blättern herum. Neben Lars’ Garten lief eine Quelle, die murmelte und rauschte, als ließe sie sich keine Zeit, vor Lust hineinzulaufen in den Sonnenschein und hinunter zu hasten nach dem großen Wasser. Lars saß auf der kleinen Bank am Haus, und sein Schatten fiel scharf und blau an die weiße Wand. Trina trat aus der Tür. Es war Sonntag, und Lars hatte das gute, blaue Zeug an. Trina strich ihm ein Stäubchen fort, und ihre Hand nahm sich Zeit, wie eine Liebkosung. Lars sah in die weiche Bläue hinein und hielt wohlgefällig still. Er streckte die langen Beine in die Sonne, und ihm war wohl. Er konnte einmal aufatmen ohne Sorgen und wissen, daß er an seinem rechten Platze stand. Darum war ihm wie damals, als er ein Junge war. Er hätte sich wälzen mögen in dem frischen, jungen Grün vor lauter drängendem Behagen. Jakob Lind kam über die Höhe zwischen dem wogenden jungen Korne daher. Er schlenderte gemächlich und hatte den Hut abgenommen.
  • 87. „Guten Morgen, Lars,“ sagte er und kam in den Garten. „Ich soll zu Jes Land hinüber, der will meinen Rat haben wegen seines Jungen. Er kann selbst nicht kommen mit dem kranken Bein.“ „Wer ist das denn?“ „Weißt du nicht, von dem sagen sie ja, wenn er in Wanbyll steht, dann wirft die Nase noch Schatten bis Seegaade quer übers Wasser, so lang ist sie.“ Lars lachte in sich hinein und nickte. „Aber dich muß ich auch was fragen,“ sagte Jakob, „wegen Jung- Klaus.“ „Na schieß los, Jakob! Ist der Jung ungezogen in der Schule?“ „Das ist es nicht. Ein Musterkind ist er ja gottlob nie gewesen. Dazu hat er zu viel Leben im Blut. Aber der Jung ist klug. Du solltest ihn was lernen lassen.“ Lars schwieg und sah wieder vor sich über das blaue Wasser in die blaue Luft hinein. Er griff nach der Pfeife neben sich und steckte sie bedächtig an. Langsam tat er ein paar tiefe Züge. Dann nahm er sie heraus und rief: „Klaus!“ „Vater!“ antwortete es aus dem Hause. „So, nun sag’s ihm, Jakob.“ Da fing Jakob Lind an und sprach bedächtig und freundlich, und Klaus stand da, stämmig und groß in der blauen Wolljacke, ein wenig breitbeinig, so, als wollte er recht festen Halt haben an der Mutter Erde, und sah Jakob stramm in die Augen. Und Jakob setzte es ihm auseinander, daß er bei den Büchern bleiben und etwas Tüchtiges werden könne. „Vater könnte das wohl durchsetzen, wenn du gern möchtest.“ „Was sollte es denn sein?“ fragte der Jung’. „Na — vielleicht Schullehrer,“ sagte Jakob.
  • 88. „Oha“, sagte der Jung’. Lars lachte. „Na, was möchtest du denn werden, du Däskopf?“ fragte er. „Ich möchte wohl werden wie du, Vater,“ sagte Klaus und sah in fest an. „Warum denn?“ Da steckte Klaus die Hände tief in die Hosentaschen und besann sich. „Weißt du, Vaa, das Fischen mag ich wohl leiden, immer so da draußen auf dem Wasser, und dann“ — er grub die Hände noch tiefer, „dir hat keiner was zu sagen, du tust gerade, wie du willst, so möchte ich auch sein.“ Da sahen sich Vater und Sohn noch einen Augenblick in die Augen. „Na, denn lauf wieder zu Mutter!“ sagte Lars. — Es dauerte gar nicht lange, da kam von hinter dem Hause das trauliche Getön einer Ziehharmonika durch die Frühlingsluft. „Er hat die Musik von Großvater,“ sagte Lars wohlgefällig. „Aber siehst du, Jakob, aus dem wird auch nichts weiter.“ Da nickte der. „Es mag wohl auch so am besten sein,“ sagte er und stand auf. „Ich meine es beinah auch,“ sagte Lars. — Und dann saß Lars noch eine Weile. Klaus war weiter fortgegangen mit seiner Ziehharmonika. Aus der Ferne kam das Klingen, und es paßte sich zusammen mit dem Murmeln des Baches. Und wie beides hineinschwamm in den Sonnenschein, war es wie eine heimliche Traulichkeit und ein sinniges Behagen in der weichen Frühlingsluft. Ja dieser Zeit taute etwas auf in Lars’ Innerm. So etwas, was noch immer wie in hartem Krampf in sich verschlossen gelegen hatte. Bei all’ seiner Schweigsamkeit war doch etwas warmes Menschliches an ihm zu spüren. Trina wagte es auch wohl einmal, von Grund aus fröhlich zu sein, wenn der lange Lars in der Nähe war,
  • 89. und es saß jetzt manchmal in seinen Augen wie bei Großvater, ganz heimlich und versteckt, wie der Schalk. — Sie lebten nicht mehr wie die Hamster oder Dachse, jeder nur für seine saure Arbeit und jeder in seinem eigenen Bau, sondern sie kamen alle zusammen, wenn sie Zeit hatten, und waren fast fröhlich dabei. Am häufigsten kamen Lars und Trina mit ihrem Jungen und Peter mit seiner ganzen Familie Sonntags zu Mutter Stina herüber. Und Mutter Stina bediente sie und saß mit ihrem traurig-ernsten Gesicht zwischen ihnen, sagte selten ein Wort und war doch von Herzen froh. Oder sie packten ihre Boote bis oben voll mit ihren schreiend- fröhlichen Kindern und fuhren mit ihnen über die Bucht, hinüber zu Kords oder nach Aalby zu und gingen zu den Linds hinauf. Aber all das waren Feiertage in ihrem Leben, denn in ihrer harten Arbeit ließen sie nicht nach. Aber daß Lars überhaupt mit andern Feiertage haben konnte, das war das Neue, was er nun endlich in seinem Leben gelernt hatte. Auch an Trinas Freuden und Wünsche dachte Lars jetzt manchmal. Als ihr Geburtstag herankam, da hörte er gegen Abend mit seinem harten Mühen auf und kam mit seinem Handwerkszeug vom Strand herauf. In der einen Hand trug er vorsichtig einen langen geräucherten Aal. Den brachte er ihr zum Geschenk. Der sollte heute abend gegessen werden. Und gegen Abend kamen sie alle im guten Zeug nach Lars’ Haus heraufgegangen, Mutter Stina und Peter und Dora und die große Tochter, die bald größer war als Jung-Klaus, und der älteste, stämmige Sohn, der ganz so aussah wie Peter. Und das Jüngste, das noch auf dem Arm getragen werden mußte, brachte Dora auch noch mit. Und nachdem sie gegessen hatten, saßen sie alle herum in der Dämmerung, und Klaus spielte ihnen ein Stück nach dem andern auf seiner Ziehharmonika.
  • 90. Welcome to our website – the perfect destination for book lovers and knowledge seekers. We believe that every book holds a new world, offering opportunities for learning, discovery, and personal growth. That’s why we are dedicated to bringing you a diverse collection of books, ranging from classic literature and specialized publications to self-development guides and children's books. More than just a book-buying platform, we strive to be a bridge connecting you with timeless cultural and intellectual values. With an elegant, user-friendly interface and a smart search system, you can quickly find the books that best suit your interests. Additionally, our special promotions and home delivery services help you save time and fully enjoy the joy of reading. Join us on a journey of knowledge exploration, passion nurturing, and personal growth every day! ebookbell.com