Jump to ratings and reviews
Rate this book

Structure and Interpretation of Computer Programs: JavaScript Edition

Rate this book
A new version of the classic and widely used text adapted for the JavaScript programming language.

Since the publication of its first edition in 1984 and its second edition in 1996, Structure and Interpretation of Computer Programs ( SICP ) has influenced computer science curricula around the world. Widely adopted as a textbook, the book has its origins in a popular entry-level computer science course taught by Harold Abelson and Gerald Jay Sussman at MIT. SICP introduces the reader to central ideas of computation by establishing a series of mental models for computation. Earlier editions used the programming language Scheme in their program examples. This new version of the second edition has been adapted for JavaScript.

The first three chapters of SICP cover programming concepts that are common to all modern high-level programming languages. Chapters four and five, which used Scheme to formulate language processors for Scheme, required significant revision. Chapter four offers new material, in particular an introduction to the notion of program parsing. The evaluator and compiler in chapter five introduce a subtle stack discipline to support return statements (a prominent feature of statement-oriented languages) without sacrificing tail recursion.

The JavaScript programs included in the book run in any implementation of the language that complies with the ECMAScript 2020 specification, using the JavaScript package sicp provided by the MIT Press website.

640 pages, Paperback

Published April 12, 2022

79 people are currently reading
348 people want to read

About the author

Harold Abelson

31 books101 followers
Harold 'Hal' Abelson, Ph.D., is Class of 1922 Professor of Computer Science and Engineering in the Department of Electrical Engineering and Computer Science at MIT, a fellow of the IEEE, and a founding director of both Creative Commons and the Free Software Foundation.

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
16 (57%)
4 stars
7 (25%)
3 stars
4 (14%)
2 stars
1 (3%)
1 star
0 (0%)
Displaying 1 - 3 of 3 reviews
Profile Image for Alper Çuğun.
Author 1 book88 followers
Want to read
October 20, 2022
The writing was unfortunately not updated and is still very unclear in lots of areas.

The code was converted to Javascript and the authors seem to only have the ternary operator to their disposal. No idea why. Maybe they think this makes their conversion more lispy?

One of many examples:

function pascal_triangle(row, index) {
return index > row
? false
: index === 1 || index===row
? 1
: pascal_triangle(row - 1, index - 1)
+
pascal_triangle(row - 1, index);
}


This is preposterously bad programming.
Profile Image for Brok3n.
1,401 reviews104 followers
July 25, 2025
Programming, in the abstract

Here is the dedication of Structure and Interpretation of Computer Programs: JavaScript Edition
This book is dedicated, in respect and admiration, to the spirit that lives in the computer.
Now, perhaps it is narrow-minded of me, but I am of the opinion that a book so dedicated and so titled ought to have something to do with real computers. My main problem with SICP (AKA "The Wizard Book") is that it doesn't. OK, that is unfair, but only slightly. I will explain.

I taught myself to program starting in 1973. A month or two after I began I was totally baffled by a bug in a simple program I wrote to do a mathematical task. The nature of the bug became clear to me only when I developed a clearer picture (vague and rudimentary at that stage of my education) of what was happening physically inside the computer when it ran my code. Once I had that concrete picture the nature of my problem became so clear to me that it was hard to understand why I had ever thought my original code would work.

SICP is based on the entry-level computer science course taught by the authors (Harold Abelson and Gerald Jay Sussman) at MIT (Massachusetts Institute of Technology) from 1980-1997. This course was so highly thought of by computer scientists that it mutated and metastasized to other universities, notably the National University of Singapore (NUS), where this JavaScript mutant version came into being (adapted from the original Scheme-based version by Martin Henz and Tobias Wrigstad).

In SICP computer programs are discussed as abstract processes. The authors describe how to build a program as a series of layers of abstraction from the highest level of description to lower levels. Implicitly they admit that somewhere, if you go far enough, the rubber has to meet the road -- the program has to describe things that happen at the bare metal level. But they never go down there. Even the final chapter, chapter 5, "Computing with Register Machines", deals only with an abstract machine.

Now, let me be clear -- abstraction is essential in programming -- and there is a lot of value in SICP. No one disputes that. But I contend that some understanding of what happens at bare metal is also essential.

This all ties into the choice of a programming language, about which I feel compelled to spend a few paragraphs. (Feel free to skip.) The original SICP used Scheme, a dialect of LISP. It is obvious from the defensiveness of SICP that even Abelson and Sussman recognized that could be a controversial choice. There are, throughout the front matter and early chapters of SICP, many paragraphs that feel like they ought to be introduced with "And now, a Word from our Sponsors" about how LISP and LISP data structures are the ideal way to program. In later chapters the authors make numerous snide remarks about C, probably the dominant programming language of that time. For instance, one exercise introduces the character "Cy D. Fect, a reformed C programmer", and C is elsewhere described as a low-level language.

This JavaScript edition is a sort of partial acknowledgement of the reality that Scheme was not destined to become the dominant programming language. However, it would be a bad mistake to think that SICP is going to teach you to program in JavaScript. In their Preface, Henz and Wrigstad admit
The book covers just a small fraction 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
Thus in chapter 2 we are introduced to data object pair, which is -- let us not play dumb -- a Scheme CONS. The main value of the JS version is that it is available on the web from Source Academy, with runnable versions of all code and exercises embedded.

One big difference, to my mind, between JavaScript and Scheme on the one hand and C on the other, is that C was designed by people who know very well how real physical computers work (this, by the way, is also true of Abelson and Sussman) and who deliberately designed a programming language to reflect and not hide physical reality (this, emphatically, is NOT true of Abelson and Sussman).

Abelson and Sussman are defensive because, in one important sense, Scheme lost the war. The sense I speak of is popularity, or breadth of acceptance. If you wish to earn a living as a programmer, familiarity with C and its successor C++ is virtually a necessity. In contrast, if the only language you feel comfortable with is Scheme, your employment opportunities will be limited. Now I don't claim that popularity is necessarily a measure of merit in any global or artistic sense. But it is not something you can afford to ignore if you intend to work with other people.

In fact, MIT stopped teaching SICP. In a video you can find by searching for "SICP: the end of an era" Sussman admits that Scheme lost the war in the sense I just described, and that other languages are now more practical. Not C -- he could never stoop so low -- but python, at least.

SICP was one of those books that evoked the dreaded "Thank God that's over!" feeling on completion. I would not recommend it to anyone.

Blog review.
Profile Image for Scott.
16 reviews
September 2, 2022
Minus one star because it is js and I prefer the lisp version, but it is still a great conceptual guide for an introductory cs book, and would most likely align with the current language popularity.
Displaying 1 - 3 of 3 reviews

Can't find what you're looking for?

Get help and learn more about the design.