Hacker News new | past | comments | ask | show | jobs | submit login
Structure and Interpretation of Computer Programs (1996) [pdf] (opendocs.github.io)
665 points by susam on Oct 19, 2019 | hide | past | favorite | 142 comments

I took a one-week SICP course with 5 or 6 other professional programmers last year. It was amazing. I wrote about my personal motivation for doing so here:


As for an update: SICP was as good as I expected and definitely makes a professional programmer regain some love for the art and magic of computer science. (However, the book is a hard read without a guide. But it's really fun if you alternate between coding and reading, by using a local Racket & DrRacket install.)

One can find recorded courses from MIT with the SICP authors on YouTube, so that may be one way to do this from home.

Hal Abelson was recently interviewed about the lasting influence of the book in this podcast. It's a good conversation:


You probably know this, but for others reading along, Racket has a #lang sicp language to fully support using Racket to follow along.


Alternatively, install MIT Scheme (*nix/macOS): https://www.gnu.org/software/mit-scheme/

If MIT Scheme runs on your computer, great. IIRC, SICP support was added to DrRacket with the idea that it would be more accessible to new students (runs on more computers, student-oriented IDE that's less-intimidating than something Emacs-ish).

I did that interview! Interestingly enough, in it Hal said javascript was the inheritor of the scheme spirit.

I worked through the book using #lang sicp in racket however.

I listened to that episode recently. Really dig your podcast; always looking forward to new episodes. I really appreciate the semi-esoteric topics while staying lucid and engaging (I think I found the podcast while I was mucking about with idris). Keep it up!

Does it make sense to use Clojure while reading the book?

There's a case to be made for alternatives to MIT Scheme. A good example of this is the exercises where you might employ the OOP system that SICP describes like the constraint-solver or metacircular evaluator but realize that you could be much more productive if you had some kind of controlled method for generating similar piles of code from some base implementation, something which is found in the object systems like CLOS like GOOPS or ChrisH's SOS or even Emacs's EIEIO here [2].

There's no impediment to completing Chapters 1 & 2 in Clojure, but the first chapters are not what is called to mind by "Structure and Interpretation of Computer Programs" [1].

- Function redefinition is extremely useful required if you want to write your code in a linear fashion as intended. Clojure automatically sets up a major hindrance here.

- A few subchapters explore parallel computation, Clojure is likely to lead you astray here as you try to find directly corresponding functions and why exactly the authors are suggesting.

- Several chapters explore mutable lists in detail. Serious complaints have been made about the suitability of Racket here, where there exists no more of a barrier than that methods which operate on mutable lists are prefixed with a specially named qualifier. Clojure would be functionally impossible here.

- On the plus side, the "JIT" meta-evaluator will be a much more interesting challenge!

You'll notice that all of these issues can be worked around. However, SICP with exercises will take you about a year if you're a serious student.

[1] Huffman trees exercises excluded.

[2] Doing the whole thing in Emacs Lisp is potentially fantastic. I don't know if I can wholeheartedly recommend it, but I would be really pleased if someone wrote tests and built the metaevaluator, compiler and really went the whole nine yards here.

I think it makes sense to use whatever language you want, and the ideas in the book don't only apply to Scheme.

I've been working through the book in Javascript - https://github.com/ahuth/sicp/. Maybe I'm losing something by doing it in JS instead of Scheme, but I'm still learning a lot and having a ton of fun.

Wrote a little bit about SICP here: https://ahuth.github.io/articles/the-first-time-sicp-blew-my....

I think if a language has decent lambdas - JavaScript qualifies - it'll work for SICP. That said, using Scheme for it will give you a much better appreciation of an underrated language.

Yes and no. Maybe use http://www.sicpdistilled.com/ as a guide.

I actually knew Clojure going into the course and it helped make Scheme easier to pick up, but I think to make the code exercises more straightforward, it's better to use Racket and #lang sicp as someone suggested.

I started with Clojure but ultimately ended up using scheme. Clojure has built in solutions to some of the things that you’re asked in exercises which I think takes away from the experience.

I’d suggest going with a scheme such as racket.

Not a lot, given that Clojure semantics are very different from Lisp semantics.

This is awesome, can you go a little bit deeper into how you organized your week? Topics you covered each day and how you devided the book to fit into a 1-week study?

I’d love to do this myself with other people! The idea of a "retreat", seeing programming as a hobby is great.

If working alone, I suggest going off the deep end and implementing the metasyntactic evaluator in any language one likes. You need to figure out how to implement lexing and parsing if this is not familiar to you, but it's not that hard.

Can you please provide your plan and outline to get through it in a week that you used? From my experience if doing all the exercises a chapter a week is still a challenge.

SICP shows up every few months on HN, and I upvote enthusiastically every single time!

I am a self-taught programmer, and survived a long time on C/C++/Java etc. I was smugly confident in my confined space.

Then I came across SICP. I discovered a world of closures, streams, object-orientation done using closures, infinite series using streams, lazy evaluation, functional programming, and so much more. It was such a sharp pivot that I registered for a PhD because I just had to know what else I took for granted. I was 42 when I registered (graduated at 48)!

Wow that is a fantastic story! Kudos for completing your PhD!

Would you mind expanding a bit more about your PhD? Which school did you go to? Did you find that your age made it more difficult to get in/stay in once accepted? How did you handle family commitments (if you had them)?

Reason I ask is because I've been considering going back to school to get a PhD.

Again, that is quite an achievement, so congrats!

Thank you much. Sorry for the wall of text, but you got me going!

I had been living and working in California, and found myself at the crest of the dot-com wave of the late 90's and early '00s. But post-SICP, I _had_ to dig deeper.

I didn't feel prepared for the schools I wanted to apply to: Berkeley & Stanford. I am totally self-taught, and not having taken an exam in any CS subjects, the subject GRE was a huge mental barrier. So I applied to the Univ. of Cambridge in the UK.

That was a miscalculation. I was expecting to sit through a number of courses before figuring out what I wanted -- the US model -- but no, I was thrown into the deep-end right away, as an independent researcher. In my earlier life, I'd prided myself in knowing a whole lot of stuff just by building things in my own time (a TCP-IP stack from scratch, a Java compiler etc). But at Cambridge, I was told the "Dragon Book" (Compilers, by Aho, Ullman and Sethi) was so 1970's! I can't tell you how inadequate and how unprepared I felt.

In just the areas I was interested in (PL, concurrency, distributed systems), I was surrounded by researchers (at the cs dept and the microsoft research lab in the adjoining building) who _defined_ world-class. Robin Milner working on Distributed Pi Calculus, Tony Hoare on separation logic, Simon Peyton Jones on Haskell and type systems, Alan Mycroft, Jon Crowcroft advising the creation of the Raspberry Pi, Ian Pratt and Steven Hand on the Xen hypervisor, Peter Sewell on a rigorous (machine-checked) definition of systems and protocols.

But me, I didn't understand any of it, at least in the first year! I had never read a non-systems paper in my life; I didn't know the meaning of academic rigor. Those four years were the hardest of my life. Age was a factor. There was a distinct difference in stamina. Later I discovered that it was more fear that stymied my progress. I used to love math in my younger days, but I realized that lately, I was putting the more formal books back on the shelf "to get back to later". In contrast, Younger kids (and particularly the ultra-bright ones who land up at Cambridge) had no such fear at all because their formative math education had been top-notch.

On the other hand, my age served me well elsewhere. I had money, I was happily married (and still am, thank you!), so half my brain wasn't stuck on relationship issues. I didn't have to impress my peers with my ability to drink. I could travel freely to conferences on my own dime. I could quit any time (or so I told myself; I'd probably have regretted it if I had quit). It helped that we didn't have kids and that my wife was immensely supportive. There was another "mature" student also with the same background and outlook as me who'd sold his company for a few tens of millions (he was on the original Pentium design team!) and come in search of knowledge. He had two kids. He had a tougher time than I did not because of his family, because of the choice of his subject (quantum computing). But ultimately, he too has done well from himself.

Any how, I knew all along I would be very glad when the program ended, on two different axes. First, that the hard period was behind me. Second, that all this learning would fundamentally change me. I'm happy to say it did. I'm happy to report that I fared well -- my dissertation was nominated for a British Computer Society dissertation award. Privately, I felt I was trained just well enough to _start_ a PhD program. That imposter syndrome never left me! I have met many many PhDs who have felt that. I wish someone had counseled me on it.

I'll leave you with this. The amount I learnt makes my toes curl with pleasure. Then there's the meta-learning. When you spend so much time reading papers and rigorous arguments, you begin to have confidence in reading a paper completely beyond your ken, and getting to its essence. That's the real value.

Thank you so much for the detailed answer! Such an inspiring story and told with such humbleness. You are inspiring.

Your note on "fear" holding you back rings a bell. As I have aged (and I have not aged that much!) I have noticed the same. And I feel like it gets worse every year. I haven't found a better solution than just jumping in outside my comfort zones, but alas, this is so hard that I find myself barely doing it.

But people like you remind me that it can be done! And this is very important because knowing that someone else did it cancels some portion of that internal discourse of "You can't do it.".

Thanks again.

Very kind of you to say this. Happy to hear that my 99% perspiration is your 1% inspiration :)

Such a detailed answer. Thank you. Unlike you, I registered for an MRes. (Masters in Research) degree at a UK but found that due to lack of taught courses I couldn’t plug the holes in my mathematical foundations. For the very few courses that were taught, quality of teaching was also an issue which presumably wouldn’t be the case at a university like Cambridge. Even though I finished with honours, I am still left with the nagging feeling that I didn’t get what I wanted out of my effort.

Quality of teaching is a problem everywhere. Universities reward researchers, not teachers. There are very few who dedicate themselves to quality teaching. Also there didn't seem to be any courses at Cambridge geared towards grad studies (or remedial education, which is what I wanted, lol). The undergrad courses were themselves much tougher compared to their US counterparts and very math-oriented.

I recall sitting through a denotational semantics course and the students (all of 18 years old) were asking apparently relevant questions, and the prof (Glynn Wynskel) would say, 'that's a good question'. And I'm sitting at the back of the class awed at this spectacle! I'm wondering what was in this kid's background that prepared him better than me for this course. I have written a compiler, dammit, and I have 20 years of experience. The odds are that I should have heard something in those 20 years that left me marginally better prepared. But no. Here I am, understanding neither the question nor the answer!

It is only in my third year that it clicked. It was just a resistance to formal math, a resistance I had no idea I had. Once I got over it, and I was able to treat math notation as a compact way of writing it out, I started having a good time.

I have a suspicion that quality teaching alone would not have solved your nagging feeling. You need soak time. I am convinced that the 1-year masters programs in the UK (and increasingly so in the US) are a scam. They are only good for the uni to make money, but the students are shafted.

Thanks for the detailed response. Point about treating math notation as a compact way of writing makes complete sense.

Wonderful narrative - thank you for writing this. It's close enough to my experience to ring many bells, but different enough that it was excellent to read.

I did Part III in '83/84 and a PhD in DPMMS from '84 to '87, and having come in to the Cambridge system from outside, I was way out of my depth. The amount I learned was quite unbelievable.

If you'd like to connect and share experiences, by contact details are in my profile.

Tripos and PhD in DPMMS and an Erdös number of 2!! Frankly I feel a bit honoured that my story had any resonance for you! Thank you for your note.

> ... a bit honoured that my story had any resonance for you!

Oh absolutely! In so many ways ...

Your story should be more than a comment on HN. Write a blog about it. How was the first week ? What subject did you have to learn and were the hardest ? etc i think people here probably have hundreds of question.

I've been thinking about starting a blog (in my dotage!) on distributed and concurrent systems. Perhaps I'll include a side-piece on this experience, for people who are considering a PhD in their "adult" years! Thanks for the prod.

Me third, I would definitely want to read more about your motivation to pursue a PhD. I guess from where I'm at today I don't see the point in pursuing one, but your comments definitely sparked my curiosity!

Yes please do write a detailed blog post on this.

How is cambridge a backup for somehody that thinks stanford or Berkeley are to prestigious?

Also how was it like applying for a PhD without an undergrad?

Oh, Cambridge was not a backup option by any means. It is just that they didn't have the subject GRE constraint, which made it one step easier to apply.

As for applying without an undergrad, I was able to parlay my industry work as relevant, because I was applying to the systems group. I'd have had far less trouble if I had just stuck to systems. I would have had to brush up on algorithms and statistics and control systems, and I would have been set.

But noooo, that would have been too easy!!

I found my attention drifting to programming languages, and then I was on totally thin ice.

This was a fantastic read. Thanks for sharing it!

thank you for a fantastic and interesting narrative!

Is your dissertation online?

Cool, thanks!

> SICP shows up every few months on HN, and I upvote enthusiastically every single time!

This book is so important I sometimes think there should be a link pinned to the front page.

It too really opened my eyes like no other book had and was a major influence on my PhD work and also subsequent projects I've done in industry. I really liked your other detailed comment about your experience, and am jealous you got to work alongside such major players in the field :)

Read any other good books in your time in school? I'm always looking for a good CS book to add to my reading list.

Oh yes. Grad school is all reading. I recall reading these books in their entirety.

Security Engineering. Ross Anderson

The Formal Semantics of Programming Languages. Glynn Wynskell.

Communicating Sequential Processes. Tony Hoare. This book is surprising in its compactness and lucidity.

Pi Calculus. Robin Milner.

Semantics With Applications. Hanne Riis Nielson

On Concurrent Programming. Fred Schneider.

Specifying Systems with TLA+. Leslie Lamport.

Distributed Algorithms. Nancy Lynch.

Reliable Distributed Computing. Ken Birman and Robert Van Renesse.

I'm sure I'll recall more as soon as I hit "reply".

Such an inspiring post. Awesome to hear your story. Did you do it part time or full time? And yes, a +1 to the comment and to the idea that you should write a blog post. Thanks!

Thank you. The PhD was full time. I am not a fan of part-time anything .. either you are doing two sub-par jobs, or you are busting a nut doing two full-time jobs.

In my earlier responses, I haven't credited my wife enough. It is one thing for me to take a chance, but it is altogether a different ball of wax for her to say we are in this adventure together.

The contents of the book are wonderful, but I can't stop admiring the TeX typesetting itself. It's startling how effortless it is to read this document compared to 99% of Web-based reading I do every day. The things that stand out to me most are the lack of vertical whitespace "rivers" due to the smart kerning & tracking, the small-caps for technical initialisms like 'HTML', and the beautiful beautiful Garamond of the body text. I should use LaTeX more :)

I agree with the spirit of this comment: good typesetting is a delight, and TeX is the best tool I've seen for achieving it. We are lucky that its author made the result of his researches freely available, and that a community has kept it alive. I'll just point out that simply using LaTeX does not automatically guarantee great typesetting (you have to know what you want) though it does provide a baseline of decent paragraphs at least. Nit: TeX/LaTeX do not inherently avoid rivers (though see https://tex.stackexchange.com/q/29049/48 and https://tex.stackexchange.com/q/4507/48), and the body font in this PDF is not Garamond but Linux Libertine.

The typesetting of this book seems due to Andres Raba (sarabander on GitHub), and the LaTeX is generated by a script from texinfo format: https://github.com/sarabander/sicp-pdf/tree/5b3a5b2/src

TeX isn't so bad when you use a typeface other than the eyeball-scarring, madness-inducing Computer Modern.

Computer Modern looks decent in print, which it was designed for (pick up any book by Knuth, not a modern book typeset with LaTeX). It looks less good on screen, partly because on-screen output barely existed at the time it was designed, and partly because what you've seen is probably not really Computer Modern: https://tex.stackexchange.com/a/361722/48

A similar story happened to Courier, which, afaik, was digitized from the designs meant for printing and thus accounting for print ink gain. On its own the the font's forms look too thin too.

To each their own of course but I rather love that typeface

What’s wrong with computer modern?

It looks so much better than my Google books edition on Android (Moto g6).

Thanks for the links.

> https://news.ycombinator.com/item?id=3034587

This one is a link to a .mobi/Kindle version, for anyone searching.

both PDF and epub versions here: https://sicpebook.wordpress.com/ebook/

The original course videos are on youtube too! I found them a bit easier to watch than reading the book:


I just started the first video. This guy is a phenomenal lecturer. Thank you for posting the link!

Had no idea these were online. Thank you!!

Anyone else feel like this book is really overrated? I've enjoyed the classical mechanics book by the same authors a lot more since it goes over a particularly good application where functional ideas shine

I do think it's a book of quality, which admittedly is a relatively rare category. But yes, I think it's hugely overrated, especially when characterized as the "one true best way" or something, to learn programming.

(Note that I am commenting on the first half or so of the book, never having gotten past that. Maybe the last half of the book is the best book ever written, I do not know.)

For one thing, half of the examples are calculus. If you are an engineering graduate student with experience in fortran (which is the original intended audience, just watch the original lectures), that's a great idea. For humans with little to no formal mathematical training, it's pretty poor. I once helped to lead a study group on SICP with half a dozen highly motivated junior-to-intermediate programmers, and everyone found the exercises insanely hard for this reason. (Of that group, btw, I would say one student greatly benefited, two dropped out, and the rest got some benefit.)

For second, I strongly disagree with the claim that functional is a "more natural" or "more intuitive" way to think about programming. I've helped teach hundreds of adult students to program (and become working developers), most of them with no prior experience, and I would say that less than 1% of them found recursion anything other than a crushing mindfuck. Whereas more than half of them took to imperative programming in a much shorter length of time (a few weeks, say). (None of these students were given SCIP, tho.)

Based on the perennial praise in threads like this, I concede that must be those in the world for whom it's a great book, and that's great. I am firmly convinced that these people are atypical.

On the other hand, it is a book that concerns itself with important questions, where IMO most books do not, so that alone makes it, as I said at the beginning, a member of a rare and distinguished category.

Oh, boy, you should really finish reading the book! The second half is amazing. I just looked through the table of contents and almost all the things I remembered most fondly are in chapters 3, 4 and 5. It's all about understanding computing paradigms and related concepts by implementing them. It does circuits, object-oriented programming languages, dataflow languages, logic programming, register machines, garbage collection, compilers, etc.

Throughout the authors have very good taste in choosing the level of detail and realism in which to implement things to let you quickly get at the core ideas without getting bogged down in technical points.

As for the first half only being fit for fortran-programming engineering students, I remember that very differently. I only remember a few examples as requiring calculus, say Newton's method, some numeric integration procedures, symbolic differentiation, power series implemented as lazy lists of coefficients, maybe one or two more. And other than the power series, I don't remember any of those examples as requiring more than just high school calculus ---which makes sense, because I think the course is meant for college freshmen, which will have only completed high school calculus, and probably are taking a more advanced calculus class concurrently.

Although judging from my own undergraduate students it is probably best not to assume most students remember calculus from high school. Plus, I understand there are countries, such as the US, where calculus isn't even compulsory in high school! So maybe removing those few calculus examples would make the book seem friendlier and shorten it by 10 pages or so.

There's an interview of Abelson floating around where he is asked why there was so much calculus in the examples and exercises. His response was that it was written for students who had just finished multiple semesters of calculus, so it made sense to use it. He goes on to indicate they made a second version, handed out as class notes to students in art degrees where the calculus was all replaced.

I also think you are introducing functional programming the wrong way to beginners. It's best and most intuitive use imho is in a math class. For example this book: https://cs.wheaton.edu/~tvandrun/dmfp/ has little prereqs, and will teach the reader both programming and math regardless of educational background. It really, really shines when it comes to learning counter-intuitive things like cardinality. I'm not the only person who thinks so either, here is one of the curriculum designers of Bootstrap, a US highschool programming curriculum, explaining how naturally that style of programming fits with algebra classes. https://www.janestreet.com/tech-talks/curriculumn-design/

Not sure about the video lectures, but I'm fairly certain the original course was taught to MIT undergrads as an intro to CS and EE. See https://people.eecs.berkeley.edu/~bh/sicp.html and https://mitpress.mit.edu/sites/default/files/sicp/course.htm....

I don't totally disagree with you btw. Pretty sure in that interview with Hal Abelson someone mentioned above, he admitted the book leaned a little heavily on calculus because all MIT freshmen had to take that course, so it seemed a natural source for examples. Perhaps not as natural to someone who hasn't taken a calculus course in a decade (me). I still got a lot out of the book though.

> but I'm fairly certain the original course was taught to MIT undergrads as an intro to CS and EE

This is correct: The course number was 6.001 and was a requirement in EECS in those days. I took it while SICP was still only notes in 1983, and the notes ended up as a book shortly after.

Actually, the course number back then was 6.031. I only become 6.001 later on.

Must not have been clear in my post: It was 6.001 in 1983, when I took the class with Sussman and Abelson. The book was still not published, and they gave it to us as xeroxed notes.

The second half of the book (Ch 4 & 5) I think are paramount to SICP, and arguably the apex of the book.

The pure-math focus is what made it a slog for me to get through, though I'm clearly not the intended audience. I was 20+ years out of college when I first read it and it had been over a decade since the last time I'd had any reason to think at all about many of the areas of math it takes as a given that the reader knows like the back of their hand. To be fair, I would have been more comfortable with the examples if I'd read the book in my first year of college, with high-school calculus still fresh in my mind. But as it was, I spent way more time reading Wikipedia pages about the math concepts in the examples than I spent thinking about the concepts the book was trying to use those examples to illuminate.

It was worth the read. I just think with a wider variety of examples, I could have gotten the exact same benefit with far less extraneous effort.

The first half of the book is basically just warm-up material to set the scene. Chapters 4 and 5 are what make it truly special.

Yes. 61A at Berkeley was nominally based on SICP. Berkeley has since abandoned the book and the class is now taught in Python. MIT 6.01 has abandoned the book as well and recreated the course using Python as well. Scheme was wonderfully elegant but then we never used it again which was annoying. If the choice is between Scheme knowing I'd never use it again and Python then I'd take Python.

We never had any readings from SICP. It sat on the shelf like an unread bible. I went back to it much later but I didn't like its conception of computer science. I compare it directly to Knuth's Fundamental Algorithms and it just didn't inspire me at all whereas FA did. I'll grant that I can't imagine a freshman course using FA, mostly because assembly language is very much de-emphasized.

However, I'll second someone else's comment about the beauty of the typesetting of this edition. And I really liked Scheme. But neither 61A nor SICP are touchstones for me.

I feel these moves are part of a general move towards "industry ready" skills and away from fundamentals earlier and earlier in computer science programs (even prestigious ones). Whether that's a good or bad thing is a separate discussion from your opinions on SICP.

What's your personal experience with SICP? It sounds like you were a student in one of these courses ("we never used it again") but you also wrote "We never had any readings from SICP." so I'm not sure what you took and when. Did you work through SICP and still find it overrated?

Sussman is still teaching SICP through his Adventures in Advanced Symbolic Programming [1].

The Python course happened clearly due to politics and popular appeal. Sussman expressed his disappointment about it multiple times. Abelson did the same in the interview that's linked in this thread.

It is sad but a good example of how far the academic institution has fallen in this century. Ultimately it is the students that really lose out.

[1] https://groups.csail.mit.edu/mac/users/gjs/6.945/

The programming language itself is irrelevant. After you have learned the concepts sicp introduces you can learn any language much faster.

SICP is not about FP, it's about all forms of programming. It starts with FP because that's the easiest model to reason about. Then it shows you how if you add state to FP, that can get you to OO. Then it shows you how you can use that to build an evaluator for your favorite programming language, or a virtual machine that can serve as a target for many languages. As a deep dive into a single topic it's not very good, but as an overview of much of computer science it's unparallelled. Knuth appears to have gone for the deep dive approach, and good on him -- but that's why TAOCP is yet unfinished.

I totally respect and even admire dissenting opinions, but, on the contrary, this book is magic for me. For me, it connects programming to larger and vital human endeavor. K&R does that for me too, so maybe it's a me thing.

K&R still holds a place for me as one of my favorite programming books. It may not hold up today, especially not for new readers, but at a time when the alternatives were Pascal, Fortran, Basic and Assembly, the C Programming Language was an intoxicating blend of power and elegance. In addition to serving as an introduction to C, K&R was opinionated in a way that I hadn't seen from other programming books to that point, with as much emphasis on style as how to get things done. It's the Strunk and White of programming (or was at the time).

I know you probably mean it as a compliment to K&R, but you shouldn't compare K&R with S&W: while both are opinionated, the advice in K&R is coherent and sensible!

S&W is a bizarre book: it's a pleasure to read because the authors are both excellent writers, but they don't know anything about grammar so their advice often makes no sense. Seriously, read it again (it's a short book) and count how many times they actually follow their own grammatical advice (their advice not about a technical grammar point is usually sound, and you should, for example, omit needless words). My opinion is that you should take S&W as style exemplar, but not a style guide.

Geoffrey Pullum's article 50 Years of Stupid Grammar Advice explains all this better than I can: http://www.lel.ed.ac.uk/~gpullum/50years.pdf

> It's the Strunk and White of programming (or was at the time).

On the chance you don't know — and because many don't — Kernighan & Plauger wrote The Elements of Programming Style a few years earlier.

Even when the alternative was (Common) Lisp?

That's an interesting comparison. K&R did nothing for me, I honestly did not understand C until I read Harbison & Steele.

K&R blew my mind when I was a teenager, but years flipping through it again it does nothing for me. I think the experience somebody will have with K&R depends greatly on their previous experiences.

It's certainly not "mind-blowing", and is not intended to be, but it is a brilliant example of how a technical book on a specific programming language should be written.

The point some of us are trying to make here is that K&R works for some learning styles but not others. It's definitely not universal.

"Blow my mind" might be a bit of an exaggeration, but whatever magic was once in the book is now gone for me. Experience with other books and other languages has shifted my perspective such that K&R no longer feels special to me.

30 years later I still love K&R . Harbison & Steele is a fantastic reference.

However, I could never get into SICP mostly because it was so... impractical and pure.

Besides i'd had enough of RPN working on https://en.wikipedia.org/wiki/Elektronika_MK-61 .

I suppose one should get into SICP when one is still at the right age (<25)

> it connects programming to larger and vital human endeavor

What endeavour exactly?

Good question -- I appreciate it. The application of human ingenuity to solving problems maybe (engineering in the widest sense). But there's something even more abstract, I think... Something more like _thinking_ most generally. It's almost like reading philosophy in the way it carefully and openly walks through a progression of thoughts...

It covers unification in a first term class, plus functional, OO, and machine models of computation. I’ve used SICP as a student, and comparing it to HtDP, CTM, or some ad box stuff as an instructor—there’s no contest. Each of the others is excellent in its own way; none is as ambitious in its intent nor goes so far in satisfying it.

I agree SICP is better than HtDP, but CTM?

CTM is in many ways a SICP sequel, and equally ambitious.

Presumably https://www.info.ucl.ac.be/~pvr/book.html - and one of the ugliest web sites I've seen in recent years.

What does a plain HTML academic site have to do with the quality of a book? The book itself is beautifully typeset in LaTeX.

Some other pointers: http://wiki.c2.com/?ConceptsTechniquesAndModelsOfComputerPro...

What was your exposure to the book? I have gone through it twice with study groups, and have done all the exercises, and feel if anything it's underrated.

I'm glad about SICP being promoted and accessible to people around the world.

Maybe 20 years ago, the authors put the full text for their textbook on the Web, as HTML. This made it more accessible to people, and set an early precedent for freely-available top textbooks on the Web (even though they presumably could've made more money by only selling print copies).

Then, since not all students' computers could run a Web browser, Lytha Ayth manually converted the HTML to Texinfo, with ASCII art of all the figures.

If one has the means to buy the printed book, doing so would seem like a nice gesture, in response to the authors' and publisher's generous sharing and example-setting.

This book more than any other has made me the programmer I am. The hardest part about telling people about this books was how to find it. +1 to the guy with the short URL to this PDF.

I'm a relative late comer to programming and having read the first 3 chapters within a year or two of starting to program "in earnest", I echo your sentiments. I feel like it really taught me how to think like a programmer. I should really finish it.

Heavily inspired by SICP, I am co-teaching CS43 during Stanford Winter quarter.

Code: https://github.com/stanfordhaskell/cs43 Site: https://stanford-lambda.gitlab.io

All of the course materials will be open-sourced @ https://github.com/stanfordhaskell/cs43 (previously Clojure, now Haskell!)

If anyone has concrete suggestions on how to improve our curricula, I would be happy to take any suggestions.

Where might I find the class materials from when you were using Clojure?

We read SICP back in college. I loved it but I remember a lot of moaning from my classmates. I wish I had more practical need for Lisp because I loved programming in it.

My favorite part of SICP is where a streaming lazy evaluated version of sin() is defined using cos() which is defined using sin().

Pictures in the PDF are garbled. The Version built from https://github.com/sarabander/sicp-pdf is much better.

The PDF in this post is built from https://github.com/sarabander/sicp-pdf. See https://opendocs.github.io/sicp/ for more details. If you have a direct link to a better rendering of this book, could you please share it? I would like to see which pages are rendered better in it.

The ebook on https://github.com/sarabander/sicp-epub/ seems to be inaccessible, trying to fetch it via git lfs gives "This repository is over its data quota. Purchase more data packs to restore access."

Does anybody know where I can/should host a copy?

> Does anybody know where I can/should host a copy?

With torrent or IPFS, perhaps? (Given the CC BY-SA license, this would be completely legal.)

Also, GitHub's behaviour wrt to LFS is really disappointing — the epub file could have been stored normally with git (its size of ~ 3 MB is far less than the hard limit of 100 MB), in which case there would have been no issues of exceeding a data quota...

For comparison, the linked PDF is normally indexed with git, despite weighing at 7.7 MB.

Since LFS is supposed to reduce total bandwidth use for the hoster, GitHub is, in effect, punishing people for reducing GitHub's bandwidth usage...

Actually, the linked PDF is originally[0] by the same author as the EPUB version you linked. However, in the original repository[0] the PDF is managed with LFS, so it's inaccessible...

[0] https://github.com/sarabander/sicp-pdf

I've cloned and built from the repo.

On Debian GNU/Linux, I had to install a few packages in addition to base tetex: latexmk fonts-inconsolata linuxlibertine fonts-linuxlibertine texlive-fonts-extra texlive-latex-extra

I also downloaded locally installed the two suggested fonts to /usr/local/share/fonts/truetype/

Build took a few minutes on an older box, but looks spiffy.

> You are probably reading it in an Info hypertext browser, such as the Info mode of Emacs. You might alternatively be reading it TEX-formatted on your screen or printer, though that would be silly.

I'm read a PDF :/

I guess that’s talking about reading the TeX markup itself.

SICP = Structure and Interpretation of Computer Programs

This book is both art and magic.

It is poetic in its treatment of introductory computer science.

I first found out about this book from someone reposting on HN a few years ago, and decided to explore it because of discussion in the comments. It significantly influenced me as a developer, and I still point junior developers toward it as one of the main books they should read (and by read, I obviously mean go through excercises) about the craft. Thanks for reposting this again.

Please, do it every couple of months.

The foreword of this book must be the only one I have ever read where I disagree with almost every statement it makes. This doesn't encourage you to carry on, but I have (first couple of chapters), and find the whole structure and direction of the thing inimical to me.

It seems to me that this is somewhat like the "dragon book" - people were exposed to it before they had read other better books.

> The foreword of this book must be the only one I have ever read where I disagree with almost every statement it makes.

I just went an reread the forward, and nothing struck me as controversial. Could you elaborate a bit?

Ohh... This was one of the books we used when I studied computer science. Great book and it brings back memories.

State is only introduced on page 294!!

I read the book a while ago, It was quite an eye opener. The one thing I haven't been able to go through was the last chapter, building a "metacircular evaluator. I saved it for a time when I understood compilers/interpreters better.

Diving into codebases, like the octave and supercollider interpreters recently. might be quite interesting to re-read it.

My experience of the last chapter is: it's not as satisfying or as easy as the previous chapters where the solutions to exercises are self-contained. It's also less suited to doing outside of school, if you only have nights and weekends and must re-establish the context every time you sit down again with the book. However, it is still worthwhile, and definitely doesn't require any previous compiler/interpreter exposure (in fact, it might be an advantage to come in fresh, as a lot of what you do in chapter 5 is really easier than you might think if you have exposure to advanced compiler techniques).

Question: will you recommend SICP as an intro to programming book for say high schoolers?

Or, does it assume some prereqs?

It requires significant math not available to most high schoolers or indeed most adults. Using it with adults with non-CS degrees, we ran into big problems with the symbolic algebra system that motivates the early chapters.


Bills itself as an intro to SICP for high schoolers.

Amusingly, the author of that book (Brian Harvey) was my professor for my first CS class, in 1996, where we used this very edition of SCIP.

Thanks, did a quick glance, looks great. Might be perfect for my needs.

It does not assume anything except algebra (and I think some minor calculus concepts are mentioned in passing, as using higher-order functions to estimate derivatives or some such, but not at all required).

However, it is designed to be used in an introductory university course led by experienced instructors. Without support, even a highly motivated high school group would have a hard time with the material and pace. So I would say it all depends on the high schoolers, and especially on the support available.

This is not true. I've watched conversations on this over the years on HN, and inevitably you get a few people saying the math is nothing to worry about, and then a bunch of people saying they had to give up because they didn't have the math background (oftentimes these are professional programmers).

My recollection from the bit of time I spent with it was that most of the examples were drawn from mathematics, often times relying on implicit bits of knowledge that would lose a reader unless they'd had long interest/experience in math.

I think the issue in divided opinions here is a matter of lost perception of the range of math knowledge: I've noticed this same communication difficulty when playing new people at Go and they ask whether I'm good or not. I never really know how to reply because on an absolute scale I'm an abysmal player—but against anyone who's never really studied the game I'll appear incredibly skilled.

When people answer that SICP requires very little math background, I think that's an accurate phrasing relative to a more global scale of math knowledge. But in the realm of folks with no particular interest in math, it requires a relatively sophisticated knowledge of mathematics.

If a high-schooler is training for math olympiads or they're on track to study math/CS/etc. at a top-tier university, they'll probably be fine. All the others will likely be completely lost.

Here's another example from today's thread: https://news.ycombinator.com/item?id=21301474

From some other replies it seems my recollection of the density of calculus in the exercises was incorrect.

However, I do think the math shouldn't be a great hurdle with the right guidance, but:

> If a high-schooler is training for math olympiads or they're on track to study math/CS/etc. at a top-tier university, they'll probably be fine. All the others will likely be completely lost.

This is probably the right answer.

How to Design Programs is probably the more appropriate choice: https://htdp.org/2019-02-24/

Thanks. How do SICP and HDP compare?

I did a quick glance and HDP seems to use DrRacket, but is the material comparable, with HDP just more appropriate for beginners??

Yes HtDP was designed to be more approachable for a wider audience and doesn't require familiarity with undergraduate freshman math, physics, and electrical engineering. It could be used as an introduction to programming and CS for anyone who's taken middle school algrebra.

For high school students, it's likely to be more appropriate.

That said, if a student expresses an interest in SICP, they shouldn't be dissuaded from tackling it.

They overlap some, but also each have unique lessons from a student would benefit.

HtDP is all about a 'design recipe' which is worth understanding even if you've studied SICP. On the other hand it's very slow-paced in comparison and won't stretch you the same way.

It assumes none. It walks you through the very fundamentals of computation.

Off topic: I appreciate your username!


I went through SICP a few years after finishing my computer science degree and enjoyed it greatly. It was a great experience and I think made me quite a bit better developer. I also became a huge fan of lisp which I think is one of the side effects of this book.

I would like to tackle SICP. I am a programming novice and would like to improve my skills.

The last time I did any kind of math that was more complex then simple operations was a long time ago and math was never my strong subject.

I have pretty much forgotten any kind of algebra, calculus etc I learnt. So assuming I know very little math, what is the best way/book/method to learn algebra/calculus etc to tackle SICP ? I would like to do that before I begin my SICP journey.

Any suggestions appreciated!!

https://openstax.org/subjects/math are pretty good.

Start with the Pre-Algebra book, then Algebra and Trigonometry, and then Calculus volumes, the first two volumes are more than enough for SICP.

This can take you two years depending on your time.

My favorite class in college, also the very first class in our Computer Science curriculum. I still use it.

When I took it at Boston University in 1987, it was my last class for the BS/CS. And one of the toughest because I had so much imperative/side-effect ridden code to unlearn.

Does the MIT Python replacement go "functional first"?

This is so great. I've been working from a terrible scanned copy for years.

The full text has been freely available online for years:


Also, the physical book is available for only $40.

Last I looked in Europe the price is more like $65, about the same as a Raspberry Pi 4 with 4GB of RAM.

I know technical books are expensive and the book has 688 pages but it seems expensive.

If somebody wants to ship their used SICP book in Romania I would love to take it. It's on my wish list since forever.

Check some second-hand online stores like abebooks (mostly ships from US so it's way too expensive) or from biblio which has more accessible shipping rates [1]

Salutari din Romania!


One of my favourite books, by some of my favourite authors.

Easy-to-remember short URL created with GitHub URL shortener: https://git.io/sicp.pdf


WTF is this?

Please don't feed egregious comments by replying: https://news.ycombinator.com/newsguidelines.html.

Flag them instead: https://news.ycombinator.com/newsfaq.html#cflag

I couldn’t figure out how to flag it. Thanks.

Applications are open for YC Summer 2021

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact