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.
本書の内容は、1980年以来MITの入門レベルのコンピュータサイエンス科目の基礎となってきました。初版が出版されたとき、私たちはすでに4年間この教材を教えており、第2版が登場するまでにさらに12年が経過しました。私たちの仕事が広く採用され、他のテキストに取り入れられていることを嬉しく思います。学生たちが本書のアイデアとプログラムを取り上げ、新しいコンピュータシステムや言語のコアとして組み込んでいくのを見てきました。タルムードの古い語呂合わせの文字通りの実現として、私たちの学生は私たちの建設者になりました。このような有能な学生、このような優れた建設者に恵まれた私たちは幸運です。
In preparing this edition, we have incorporated hundreds of
clarifications suggested 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.
この版の準備にあたり、私たち自身の教育経験やMIT内外の同僚からのコメントから示唆された何百もの改善を取り入れました。本書の主要なプログラミングシステムのほとんどを再設計しました。汎用算術システム、インタプリタ、レジスタマシンシミュレータ、コンパイラなどです。また、IEEE Scheme標準(IEEE 1990)に準拠したあらゆるScheme実装でコードが実行できるよう、すべてのプログラム例を書き直しました。
This edition emphasizes several new themes. The most important
of these is the central role played by different approaches to
dealing with time in computational 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 programming
(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.
本書の初版はMITの1セメスター科目のシラバスに忠実に従っていました。第2版の新しい教材をすべて含めると、1セメスターですべてをカバーすることは不可能なので、教員は取捨選択する必要があります。私たち自身の授業では、論理プログラミングの節(
[4.4]節)を省略することがあり、学生にはレジスタマシンシミュレータを使わせますがその実装は扱わず(
[5.2]節)、コンパイラについては概要のみを簡単に説明します(
[5.5]節)。それでも、これは依然として集中的なコースです。最初の3章か4章だけを扱い、残りの教材は後続のコースに回すことを望む教員もいるでしょう。
The World Wide Web site
of MIT Press
provides support for users of this book.
This includes programs from the book,
sample programming assignments, supplementary materials,
and downloadable implementations of the Scheme dialect of Lisp.
Harold Abelson and Gerald Jay Sussman
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 MinskyWhy 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.
「計算機プログラムの構造と解釈」は、マサチューセッツ工科大学のコンピュータサイエンスの入門科目です。電気工学またはコンピュータサイエンスを専攻するMITのすべての学生に必修であり、「共通コアカリキュラム」の4分の1を占めます。このカリキュラムには他に、回路と線形システムに関する2科目とデジタルシステムの設計に関する1科目が含まれます。私たちは1978年以来この科目の開発に携わっており、1980年の秋から現在の形でこの教材を毎年600人から700人の学生に教えてきました。これらの学生の大半は、コンピュータに少し触れたことがある者や、豊富なプログラミングやハードウェア設計の経験を持つ者もいますが、計算に関する正式な訓練をほとんどあるいはまったく受けていません。
Our design of this introductory computer-science subject reflects two
major concerns. 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.
私たちの目標は、この科目を修了した学生がプログラミングのスタイルの要素と美学について良い感覚を持つことです。大規模システムにおける複雑さを制御するための主要な技法を習得していること。模範的なスタイルで書かれていれば、50ページのプログラムを読む能力があること。何を読まないべきか、どの瞬間にも何を理解する必要がないかを知っていること。そして、原著者の精神とスタイルを保ちながら、プログラムを修正することに自信を持てることです。
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 systems 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 science
is not a science and that its significance has
little to do with computers. The 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.
教材を教える際に、私たちはプログラミング言語 Lisp の方言を使用します。言語を正式に教えることはありません。その必要がないからです。ただ使うだけで、学生は数日で身につけます。これは Lisp 系言語の大きな利点の一つです。複合式を形成する方法がほとんどなく、構文構造もほぼありません。すべての形式的特性は、チェスのルールのように1時間でカバーできます。短い時間で言語の構文的な詳細を忘れ(そもそもないのですから)、本当の問題に取り組むようになります—何を計算したいのか、問題をどのように扱いやすい部分に分解するか、そしてその部分にどう取り組むか。Lisp のもう一つの利点は、私たちの知る他のどの言語よりも多くの、プログラムのモジュール分解のための大規模戦略を(強制はせずに)サポートしていることです。手続きの抽象化やデータの抽象化を作ることができ、高階関数を使って共通の使用パターンを捉えることができ、代入とデータのミューテーションを使ってローカルな状態をモデル化でき、ストリームと遅延評価でプログラムの部分をつなぐことができ、組み込み言語を容易に実装できます。これらすべてが、段階的なプログラムの設計、構築、テスト、デバッグを優れたサポートで提供する対話型環境に組み込まれています。John McCarthyを始めとするすべての世代のLispの魔法使いたちに、前例のないパワーとエレガンスを備えた素晴らしいツールを作り上げてくれたことに感謝します。
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
mathematicians who scouted out this territory decades before computers
appeared on the scene. These pioneers include Alonzo Church, Barkley
Rosser, Stephen Kleene, and Haskell Curry.
私たちが使用するLispの方言であるSchemeは、LispとAlgolのパワーとエレガンスを融合させる試みです。Lispからは、単純な構文に由来するメタ言語的なパワー、プログラムのデータオブジェクトとしての一様な表現、そしてガベージコレクション付きのヒープ割り当てデータを取り入れています。Algolからは、Algol委員会に参加したプログラミング言語設計の先駆者たちからの贈り物であるレキシカルスコーピングとブロック構造を取り入れています。Churchのラムダ計算とプログラミング言語の構造との関係についての洞察について、John ReynoldsとPeter Landinに言及したいと思います。また、コンピュータが登場する何十年も前にこの領域を開拓した数学者たちへの恩義も認識しています。これらの先駆者には、Alonzo Church、Barkley Rosser、Stephen Kleene、そしてHaskell Curryが含まれます。
Harold Abelson and Gerald Jay Sussman