|
|
Concepts, Techniques, and Models of Computer Programming
Textbook and Reference Work
|
MIT
Press,
hardcover, 900pp+xxix, ISBN 0-262-22069-5, March 2004
“More is not better (or worse) than less, just different.”
— The paradigm paradox.
“Wonderful book, very insightful, strangely easy to read
(haven't figured that out yet), very unusual in many respects.”
— Doug Merritt.
“The overarching achievement of this book is to be
so provocative that one wants to engage the authors in debate about almost
everything they say. Partly this is due to the chirpy writing style [...] but mostly
it is their delicious iconoclasm.”
— Peter Gammie, Book Review, Journal of Functional Programming, March 2009.
News items |
URLs | News item |
Programming
paradigms poster
|
Poster showing all major programming paradigms and their relationships.
|
Translations
|
Since the end of 2007, translations of the book exist
in French, Polish, and Japanese.
A Spanish translation is upcoming
(contact Juan Diaz).
|
CTM Wiki
|
There is a Wiki devoted to discussions about the book and its approach
(thanks to Dominic Fox).
|
Course
in French
|
There are now full course materials, a book, and software in French.
|
IRCAM and UPMC
|
P. Van Roy gave talks on programming paradigms
including functional, concurrent, and
multiagent programming at IRCAM and UPMC in 2006, 2007, and 2008.
|
Active book demo
|
A demonstration was made of an active version
of chapter 4 (Declarative Concurrency) at the
UPMC/ScienceActive
stand of the colloquium L'Université
à l'Ere du Numérique,
May 22-24, 2006, Paris, France.
|
The Reasoned Schemer in Oz
|
Many of the examples from
The Reasoned Schemer
have been translated into Oz by Chris Rathman.
|
FLOPS
2006
|
P. Van Roy gave an invited talk at FLOPS 2006
(Apr. 24-26, 2006, Fuji Sosono, Japan)
on what we can learn about a definitive programming language
(article,
talk slides,
demo code).
|
Colombian edition
|
The book is available in a Colombian edition since late 2005,
by the Universidad del Valle and the Pontificia Universidad Javeriana
(see Tienda Javeriana store at Javeriana).
|
Lecture tour
|
P. Van Roy visited and gave talks at five American universities
during the week of Nov. 7-11, 2005.
|
Springer Web site,
table
of contents,
order form
|
The MOZ 2004
proceedings are now available as Springer LNCS volume 3389,
with a foreword by Peter Norvig of Google, Inc.
|
CLEI 2005
|
CLEI is the major annual Latin-American computer science conference
(Oct. 10-14, 2005).
P. Van Roy gave a keynote talk and a tutorial
on concepts-based teaching of programming.
|
Prentice-Hall of India
|
There is an Eastern Economy Edition
for India, Pakistan, and neighboring countries
that is available since early 2005.
|
This textbook brings the computer science student
a comprehensive and up-to-date presentation of
all major programming concepts, techniques, and paradigms
in a unified framework.
The textbook is designed for second-year to graduate courses
in computer programming.
It is also designed for practitioners and researchers:
it gives insightful discussions on many topics,
reconciles opposing viewpoints,
and emphasizes concepts of lasting value.
It has the following notable features:
- Concurrent programming:
The broadest presentation of practical concurrent programming
available anywhere.
One third of the book is devoted to concurrent programming.
All important paradigms are presented, including
the three most useful ones:
declarative (dataflow) concurrency, message-passing concurrency,
and shared-state concurrency.
- Data abstraction:
The broadest presentation available anywhere
of the different ways to do data abstraction.
Pure object-oriented languages use only one way,
but we show that there are at least four different ways.
Each has its own trade-offs and real-world metaphors.
For example, we explain the trade-offs between
objects and abstract data types, and how to use
polymorphism with both.
- Programming paradigms:
The most complete integration of programming paradigms
available anywhere.
We show that multiparadigm programming is natural
and that the conventional boundaries between paradigms
are artificial and limiting.
We show programming as a unified discipline.
We single out the four languages
Erlang, Haskell, Java, and Prolog
as representative members of important paradigms
and situate them within our uniform framework.
- Practicality:
A comprehensive presentation of practical programming techniques,
illustrated with more than 1000 programs and program fragments.
All can be run on the accompanying open source development platform,
the Mozart Programming System.
- Formal semantics:
A complete and simple formal semantics
designed for practicing programmers.
It makes it possible to understand programs,
to predict behavior, and to calculate execution time and memory usage.
The formal semantics is at the service of programming.
It is as simple as possible without sacrificing rigor or coverage.
The book is organized around programming concepts.
It starts with a small language containing just a few concepts.
It shows how to design, write programs, and reason in this language.
It then adds concepts one by one
to overcome limitations in expressiveness.
In this way, it situates all major programming paradigms
in a uniform framework that is as simple as possible,
but no simpler (see the table of contents).
More than twenty paradigms are given,
all represented as subsets of the multiparadigm language Oz.
We find that all have their place:
“more is not better (or worse) than less, just different”.
Here are a few highlights of the book.
• • A presentation of declarative concurrency,
a little-known but extremely useful paradigm for concurrent
programming without race conditions.
With declarative concurrency,
functional building blocks such as map, forall, and fold
take on new meaning as concurrency patterns.
This paradigm is especially useful for multicore programming
and for distributed parallel programming (e.g., MapReduce).
• • An explanation of why the right default for structuring
programs is as concurrent components that communicate
through asynchronous message passing.
• • A mixed declarative/imperative
approach to graphical user interface design that is
well-suited to context-sensitive and plastic user interfaces.
• • A lift control system using multi-agent programming.
• • A transaction system using optimistic concurrency
control with strict two-phase locking and deadlock avoidance.
• • A deep discussion of the uses and limits of declarative programming.
• • A survey of programming techniques using lazy evaluation.
• • An efficient approach to network-transparent distributed programming.
• • An introduction to constraint programming.
What other people say
Endorsements
Book
review by
Scott Johnson
on the original
WikiWikiWeb hosted by
Cunningham & Cunningham, Inc.
Book
review
by Yves Deville
et al in
Theory
and Practice of Logic Programming, Cambridge University Press,
vol. 5, issue 4-5, pp. 595-600, July 2005.
Book review by
Edgar R. Chavez in ACM Computing Reviews,
July 18, 2006 (requires ACM account).
Book
review by Ranjit Mathew, Jan. 21, 2007.
Book
review by Peter Gammie in
Journal
of Functional Programming, Cambridge University Press,
vol. 19, issue 2, pp. 254-256, March 2009.
Ask Google about popular programming textbooks and see where we stand:
ask the oracle
Ask Google Image Search about programming paradigms and see where we stand:
ask the oracle
The TUNES Project recommends
the book in its
PL 101
Learning Lounge course on Programming Languages.
Some comments
that appeared on blogs, newsgroups, and other public forums,
regarding the book and online drafts from 2003.
• •
“Just finished reading it and I feel like I have read the Bible.”
(Slashdot article,
June 18, 2003)
• •
“In many ways [book title] feels like an (overdue) update of
'Structure and Interpretation of Computer Programs'.”
• •
“The Rosetta Stone of software.”
• •
“One of the best CS books that I have ever read.”
• •
“One of the rare books you can really learn programming science from.”
• •
“A book of great wisdom.”
• •
“It seems just about every page of the book introduces some new concept
requiring contemplation and digestion.”
• •
“If you doubt that any language could possibly merge all these
paradigms and still be useful, look at the draft of the upcoming book [book title]
where the underlying ideas are clearly spelled out.”
• •
“I'd recommend this book to anyone thinking about programming.”
• •
“Van Roy and Haridi might be the first good text on programming languages.”
• •
“In short, this is a Masters in Computer Science in one language and text.”
Free course material, talks, and articles
- Poster:
showing the principal programming paradigms and their relationships
(programming
paradigms poster in JPEG).
The poster is inspired by CTM and shows more than 20 paradigms.
- Supplements Web site:
a large amount of course material (more than 2000 slides),
an animated kernel language interpreter,
code supplements and technical information for the Mozart system, and a list of
errata.
- Errata page:
an up-to-date list of errata for the various printings of the book.
-
CTM Wiki:
devoted to discussions about the book (called “CTM”) and its approach.
We thank Dominic Fox for taking the initiative in setting up and maintaining this Wiki.
- CTM in other languages:
has translations of many programs from many well-known programming books and projects
(SICP, TRS, EOPL, CLRS, PFDS, 99 problems, Project Euler, etc.) into Oz,
as well as other languages (Alice ML, Erlang, etc.).
We thank Chris Rathman for doing these translations.
- Since the book is now available,
we have removed the online draft at the publisher's request.
If you find a copy of this draft on the Web, please be warned
that the published book has a huge number
of improvements and corrections.
On the Web, we found low prices at various places (discounts
change quickly, so it pays to look at various bookstores).
Amazon (USA and UK) has some interesting reviews of the book.
Talks
- Two invited talks given at IRCAM (in French):
an overview of functional, concurrent, and multiagent programming
given on
May 12, 2006
(PDF,
demo code)
and a survey of the main programming paradigms given on June 11, 2007
(slides and other information: in English,
in French).
- Best overview talk:
Here is the set of handouts that we gave out at
the Birds of a Feather session
A
Concepts-Based Approach for Teaching Programming
held at SIGCSE 2005,
St. Louis, Feb. 24, 2005
(PDF,
PowerPoint).
This is our most complete and up-to-date overview of the approach.
- The concepts-based approach of the book was presented at an invited talk
to the British Computer Society's
Advanced Programming
Specialist Group, London, Dec. 9, 2004
(PDF,
PowerPoint).
- A shorter presentation of the approach was given at the
Birds of a Feather session held at
SIGCSE 2004, March 2004
(Peter's slides,
Seif's slides).
The book was officially presented by MIT Press at this conference.
- See also the panel discussion
The Role of Language Paradigms in Teaching Programming
at SIGCSE 2003, February 2003
(PDF article
and
PDF position
statement).
- There are two older talks on
the concepts-based approach and its use of kernel languages.
There is a small talk of 23 slides
(PostScript,
PDF, and
PowerPoint).
There is a
large talk of 47 slides that gives more detailed examples
(PostScript,
PDF, and
PowerPoint).
Articles
- The approach was presented in the article
Teaching Programming with the Kernel Language
Approach,
Workshop on Functional and Declarative Programming
in Education (FDPE02),
part of PLI2002,
October 2002, Pittsburgh, PA
(PostScript,
PDF).
An early version appeared in
IFIP Working Group 3.2 Working Conference "Informatics Curricula,
Teaching Methods, and Best Practice" (ICTEM 2002),
July 2002, Florianopolis, Brazil.
- The approach was presented in the article
Programming as an Engineering Discipline
by Juris Reinfelds,
32nd ASEE/IEEE Frontiers in Education Conference (FIE 2002),
November 2002, Boston, MA
(PDF).
- The concepts-based approach, which is intended in the book
for second-year to graduate courses, was discussed as a possible
approach for introductory (first-year) courses in a working group held at
ITiCSE 2003
from June 28 to July 2, 2003 in Thessaloniki, Greece.
The working group report is available as Research Report RR2003-08
from the UCL Dept. of Computing Science and Engineering
(PDF).
Other links
- A
poster
of the principal programming paradigms and their relationships
(programming
paradigms poster in JPEG).
The poster is inspired by CTM and shows more than 20 paradigms.
-
The book
Springer-Verlag LNCS volume 3389, published March 2005,
gives a snapshot of the work being done with Mozart/Oz,
one of today's most comprehensive and well-designed
multiparadigm programming systems.
This volume can be ordered directly from Springer using
this order form
or via the
Springer Web site.
-
The MOZ 2004 conference,
held on Oct. 7-8, 2004,
brought together people
interested in the Oz programming language and
the Mozart development platform, which are used by the book.
The proceedings are available as
Springer-Verlag LNCS volume 3389 (see previous item).
- The
Oz publications page
gives a partial list of scientific publications
related to the Oz language and the Mozart system.
- The Math-Thinking
Working Group
mentions the book and its use in teaching on its Web site.
This working group is devoted to increasing the emphasis on precise thinking
(mathematical reasoning in particular) in the computer science curriculum.
- Lambda the Ultimate,
a popular weblog devoted to the study of programming languages,
has often mentioned the book.
The CTM Wiki has a link to
discussions
on Lambda the Ultimate that mention the book.
- Multiparadigm
Programming in Oz, by Martin Müller, Tobias Müller,
and Peter Van Roy, DFKI Research Report RR-95-16
(PDF).
Workshop on the Future of Logic Programming,
International Logic Programming Symposium (ILPS 95), Portland, Oregon, Dec. 1995.
An early article that precurses some of the ideas in the book.
Open source software support
The book is designed to be accompanied by version 1.3.0 of
the Mozart Programming System
(released on April 15, 2004) and all later versions.
Mozart is a production-quality development platform
that can run all code fragments in the book.
The Supplements
Web site gives the code supplements to Mozart that are used by the book.
Mozart is available without charge under an Open Source license.
It exists for various flavors of Unix and Windows and for Mac OS X.
Mozart is actively developed and maintained by the Mozart community
(version 1.4.0 was released on July 3, 2008).
We chose Mozart for the textbook because it implements Oz,
a multiparadigm language that
supports the concepts-based approach perfectly well.
Oz combines in a natural way many concepts traditionally associated
with different programming paradigms.
This makes Oz difficult to classify: it is a functional language,
a logic language, an object-oriented language,
a dataflow language, a constraint language, and much more.
Using a single language instead of several
(e.g., Java, Prolog, Haskell, and Erlang)
makes it easier to show the deep relationships
between the paradigms
as well as reducing the administrative burden
for student and teacher (only one system needs
to be installed and learned instead of many).
Teaching with the book
There are several sets of course material available free
(more than 2000 lecture slides, also tutorials, lab sessions, and exams) on the
Supplements
Web site.
You can use and modify this material freely for your own courses.
The
CTM in Alice site
has translations of many of the book's example programs
into the statically typed language Alice.
The TRS in other languages
site has translations of many of the examples
from The Reasoned Schemer
into Oz.
The book has been available since March 2004, but drafts
have been used before that for teaching.
What follows in this section is a list of
some institutions that use the book and their courses.
If you are teaching a course with the book or thinking of teaching one,
we would appreciate hearing from you.
Complete courses
Some courses that use the book as primary text
(unfortunately, this list is more and more out of date, please send me mail
if you want to be mentioned here):
- Com S 541 -
Programming Languages 1,
a graduate course
given at Iowa State University (Ames, Iowa) (Fall 2006)
and COP4020 - Programming Languages I
at the University of Central Florida (Orlando) (Fall 2007),
both by Gary T. Leavens.
- CS 330:
Principles of Programming Languages,
given at Brigham Young University (Provo, Utah)
by Irene Langkilde Geary (Fall 2005).
- 689 --- Programming
Language Design,
given at Texas A & M University (College Station, Texas)
by Jaakko Järvi (Spring 2005).
- CSCI-4430 Programming Languages,
given by David R. Musser (Fall 2004), and
CSCI-4430/6969
Programming Languages,
given by Carlos Varela (Spring 2005, Fall 2005),
upper-level undergraduate courses
given at Rensselaer Polytechnic Institute (Troy, New York).
- CS 68: Principles of
Programming Languages,
given at Dartmouth College (Hanover, NH)
by Chris Bailey-Kellogg (Winter 2005-6).
- TDT4165 Programming Languages,
a third-year course
given at the Norwegian University of Science and Technology (Trondheim)
by Øystein Nytrø and Per Holager (Spring 2004-5, Fall 2005).
- Fundamental
Programming Techniques,
a masters-level course
given at the Universidad del Valle (Cali, Colombia)
by Juan Francisco Díaz Frias and Andrés Becerra Sandoval (Spring 2004).
- Programming Languages,
a graduate course given at the
Università degli Studi del Sannio (Benevento, Italy)
by Michele Di Santo (Spring 2004-5).
- CS
460 Artificial Intelligence,
an advanced undergraduate course given at
California State University Los Angeles
by Russ Abbott (Fall 2005).
- CSCI 300,
Programming Languages,
an undergraduate course given at Xavier University (Cincinnati, Ohio)
by Gary Lewandowski (Fall 2005).
- Concepts,
Techniques, and Models of Computer Programming,
an undergraduate course given at Linköping University (Sweden)
by Anders Haraldsson (Fall 2005).
- CS2104 Programming Language Concepts,
an undergraduate course
given to first and second year students
at the National University of Singapore by Seif Haridi (Fall 2003)
and Wei-Ngan Chin and Stefan Andrei (Fall 2004-5).
- Datalogi II,
a second-year introduction to programming concepts
for both CS majors and non CS majors
given at the Royal Institute of Technology (KTH), Sweden,
by Seif Haridi
(Fall 2001),
Christian Schulte
(Fall 2002-3),
and Dilian Gurov (Fall 2004-5).
- Informatique 2 (FSAB1402) (Fall 2005),
Informatique T4
(FSAC1450) (Fall 2004), and
LINF1251
(Spring 2002-5),
all second-year introductions to computer programming,
INGI2131,
a third-year introduction to concurrent programming (Spring 2003-5), and
INGI2650, a third-year introduction
to the structure of algorithmic languages (Fall 2001),
all at the Université catholique de Louvain,
Louvain-la-Neuve, Belgium, by Peter Van Roy.
- CS532, a graduate course
on declarative programming (Fall 2001-3),
and CS437, a fourth-year course
on distributed systems (Spring 2001),
both given at Cairo University, Egypt, by Reem Bahgat.
- Programmierkurs
Mozart, a graduate course on declarative
and constraint programming given at the University of Dortmund,
Germany, by Stephan Lehmke and Hubert Wagner (Summer 2003).
- EE590, a graduate course on distributed computing (Fall 2001),
and EE490/590, a graduate course
on programming concepts,
both given at New Mexico State University, Las Cruces,
by Juris Reinfelds (Spring 2002).
Partial courses
Some courses that use the book
for a significant part of their course material:
- High-level notions
of computations and programming language concepts,
a graduate course
given at the University of Linköping (Sweden)
by Anders Haraldsson (Spring 2005).
- Constraint
Programming,
an undergraduate course
given at the Universidad del Valle (Cali, Colombia)
by Juan Francisco Díaz Frias (Spring 2004).
- PC111,
a final-year optional course on constraint programming
given at the Pontificia Universidad Javeriana (Cali, Colombia)
by Camilo Rueda (Spring 2004).
- CS5340, Advanced Operating Systems and Distributed Computing,
a graduate course given at
the University of Texas at El Paso
by Juris Reinfelds (Spring 2004).
- CS5223,
an introduction to distributed systems, algorithms, and computing
given at the National University of Singapore by Seif Haridi (Spring 2004).
- 2G1915, a fourth-year course on concurrent programming
given at KTH by Vladimir Vlassov (Spring 2002).
- INGI2655, a fourth-year introduction to the semantics of
programming languages,
given at the Université catholique de Louvain,
Louvain-la-Neuve, Belgium, by Peter Van Roy (Spring 2002-3).
- SOFTENG 325 SC,
a third-year course on software architecture
given at the University of Auckland, New Zealand.
The course consists of three parts; the first part uses the book.
The first part is taught by John Hamer (Summer 2003).
- Multi-Paradigm Programming
in Oz for Natural Language Processing,
given at the Graduate School of Language Technology,
Gothenburg University, Sweden, by
Torbjörn Lager and Denys Duchier (Spring 2003).
- EE590, a graduate course on distributed computing
given at New Mexico State University, Las Cruces, by Juris Reinfelds (Fall 2001).
The concepts-based approach for teaching programming
Scientific foundation
The book's scientific foundation is
the kernel language approach.
In this approach,
practical programming languages are defined by translating them
to kernel languages that consist of
a small number of programmer-significant concepts.
A wide variety of programming languages and paradigms
can be defined as subsets of a general kernel language.
The general language
is easy to understand by practicing programmers
and has a simple formal semantics
that allows programmers to reason
about correctness and complexity at a high level of abstraction.
The simplicity of the semantics means that
the language's behavior is easily predicted.
Even if programmers do not use the semantics directly,
its mere existence ensures that there are no
unpleasant surprises.
The semantics supports whatever degree of formality
best suits the problem: from the most rigorous formal methods
to the most intuitive craftsmanship.
The two approaches most similar to the kernel language approach are
the foundational calculus and the virtual machine.
We explain how
the kernel language approach differs from these approaches.
A foundational calculus, like the
lambda-calculus or pi-calculus, reduces programming
to a minimal number of primitive concepts.
This is especially useful
for the theoretical study of computation.
A virtual machine defines a language in terms of
an implementation on an idealized machine.
This is especially useful for language implementors and compiler writers.
The problem with both approaches is that any realistic program written
in them will be cluttered with technical details about language mechanisms.
The kernel language approach
avoids this clutter by choosing concepts wisely.
The kernel languages are designed for programmers.
How concepts lead to multiparadigm programming
We define the precise concept of computation model to
capture the intuitive concept of “programming paradigm”.
Each kernel language is the basis of a computation model.
The book introduces more than twenty computation models
in a uniform framework and in a progressive way.
Programming paradigms appear as a kind of epiphenomenon,
depending on which concepts one uses.
We examine the relationships between
the models and show how and why
to use different models together in the same program.
This leads to multiparadigm programming
in a completely natural way.
Often models that seem vastly different have
kernel languages that differ only in one concept
(e.g., this is the case for
declarative versus object-oriented programming).
General models covered include
declarative programming (functional and logic),
imperative programming (component-based and object-oriented),
and concurrent programming (both synchronous and asynchronous,
including dataflow, streams, lazy execution,
message passing, and shared state).
Specialized models covered include
graphical user interface programming,
distributed programming,
and constraint programming.
All models are fully implemented
for practical programming and
incorporate many of the latest research ideas.
The current trend in computer science education
is to restrict the student to one or two models.
The most extreme case is where
a single rather complex model and language,
namely object-oriented programming in Java,
is used as a general-purpose approach
with which all problems should be solved.
This trend is driven by market forces and
has no scientific basis.
One goal of the book is to be a counterweight to this trend,
to situate object-oriented programming in a more general context.
In addition to giving the student a deep insight,
this has immediate practical benefits.
Many problems that are hard to solve in Java
become simple when viewed in the proper computation model.
For example, both concurrent programming and graphical user interface
design are difficult in Java.
The book shows how these two areas can be much simplified.
History
The Mozart Board
The Mozart system is being actively developed by the Mozart
community, with the guidance and responsibility of a core group,
the Mozart Board.
The Mozart Programming System was originally developed
by Gert Smolka and his research group at Saarland University
in the early 1990s. At that time it was called DFKI Oz.
In 1999, development continued with an international group,
the Mozart Consortium, that consisted of Saarland University,
the Swedish Institute of Computer Science, and the Université
catholique de Louvain.
In 2005, the responsibility for managing Mozart development
was transferred to the Mozart Board, with the express purpose
of opening Mozart development to a larger community.
The authors
The authors have been collaborating closely since 1995.
They started writing the textbook in 1999.
Both have extensive experience in different
areas of computer science including
hardware and software systems,
programming language design and implementation,
parallel and distributed systems,
simulation,
logic and constraint programming,
and application development.