20 ms·
Why "Structure and Interpretation of Computer Programs" matters (2011)
- MeteorMarc 2y agoI miss the structure in the layout of this read.
- patrickmay 2y agoEvery time I read about SICP, I get frustrated all over again about Javascript. It could have been Scheme and all web development would have benefited.
- fire_lake 2y agoHey, at least there’s Clojurescript.
- snek_case 2y agoJavaScript was originally developed in two weeks due to time constraints from Brendan Eich's employer. It would probably have just as many design mistakes if he had stuck with a scheme-like syntax instead. It's just hard to create a well-designed language in such a short amount of time.
- ralphc 2y agoThe only way it would have "benefited" would be that the web would only be developed by lisp programmers. To the vast majority of programmers, syntax matters. C-style with brackets, or python whitespace, or Ruby do/end, these fit better the brains of the majority of programmers. Perhaps not the majority of HN readers but the majority of corporate devs. Another example of this is Erlang and Elixir. Elixir adds a couple of features over Erlang, macros and protocols, but Erlang does everything else. What made Elixir take off where Erlang didn't, after decades, is that Elixir has a syntax that people are comfortable with. Erlang has a syntax that will summon Cthulu.
- sakras 2y agoIs it an innate property of humans that the curly-brace style is more natural? I wonder if in an alternate universe where Lisp took off as the browser language people would find it more natural instead. It seems like somewhat of a chicken-egg problem.
- lmm 2y agoI think it's innate that having differentiated syntax for different types of grouping is natural. Look at mathematical papers where people will introduce new brackets with new meanings. (Indeed look at the entirety of QM for a clear, simple case)
- nequo 2y agoSome Scheme and Lisp dialects have that. For example, Racket often uses square brackets instead of parentheses for things like clauses of a cond expression, and Clojure uses square brackets for vector literals and curlies for hash map literals.
- lispm 2y ago> "Look at mathematical papers where people will introduce new brackets with new meanings" Common Lisp has left brackets like {} and [] to the user (aka developer). It supports "reader macros", where the user can extend/supersede the syntax of s-expressions. So, specialized tools/libraries/applications can introduce these brackets for their own use. Examples are embedded SQL expressions, notations for Frames (special objects, in kind of a mix of OOP and Logics), grammar terms, etc. Thus it explicitly supports the idea of "people will introduce new brackets with new meanings".
- odyssey7 2y agoECMAScript 2015: proper tail calls are now in the spec Chromium: we’re not doing proper tail calls
- davexunit 2y agoBut now they have them... for WebAssembly.
- potsandpans 2y agohaving call/cc would make my life better
- ipnon 2y agoI should write a Lisp browser.
- foldr 2y agoR5RS Scheme (standardised in 1998) didn't even have structs. To make anything like the DOM practical, you'd have needed some non-standard extensions that could well have ended up being a mess anyway.
- epolanski 2y agoAs someone who's both versed in Lisps (CL, Racket, Scheme, Clojure) and JavaScript: thank god. It's like the Lisp crowd can't be honest with itself and not realise the serious shortcomings of lisp projects are: maintainability. Every single lisp project out there, hell this also applies to Haskell, is so radically different because everybody's too busy reinventing its own abstractions and macros (and language extensions in case of Haskell) that you just throw your hands up in the air in dismay. It's like the Lisp crowd, that can barely attract like-minded people to collaborate on some simple open source projects out there so you get 20 broken JSON parsers, cannot see the link between that issue and industrial lisps. I love lisps, they are fun, they have their place in the industry when you leverage them to their core strengths. Try to ask yourself: why does PHP has more quality killer-software than all of lisps combined?
- commandlinefan 2y ago> everybody's too busy reinventing its own abstractions Isn't that the problem with Javascript too, though? Javascript isn't good enough, let's all use jQuery. No, jQuery isn't good enough, let's all use Vue. No, Vue isn't good enough, let's all use Angular. No, Angular isn't good enough, let's all use React. No, React isn't good enough, let's...
- shepherdjerred 2y agoThis is very disingenuous. The frontend world does move quickly, but the part of the stack you're describing has been reasonably stable. Vanilla JS was replaced by jQuery after about a decade. A decade later, React/Vue/Angular (React came first, not last) replaced jQuery There was a paradigm shift in the kind of websites that people wanted to build. For better or worse, we went from HTML + CSS with some JavaScript (jQuery) to SPAs. It's easier for a team of junior developers to build a SPA with React compared to jQuery. The abstractions that you're describing changed because the goal changed. --- There has been plenty of churn around build tools, libraries on top of React/Vue, the paradigms within React/Vue (Hooks, Vue 3 composition API), state management libraries, and the adoption of TypeScript. Again, this isn't really reinventing abstractions as much as dealing with an evolving language that wasn't designed for the applications we're building today (though it is clearly quite capable!)
- zeroCalories 2y agoI always see people gush over this book, but is it still worth reading for someone that already has a ton of experience programming?
- lisper 2y agoYes. But instead of taking my word for it why don’t you just start reading it and decide for yourself?
- vsuperpower2020 2y agoDo you really need this explained? It's a 600 page technical book and people have a limited amount of time to sort through everything that exists.
- lopatin 2y agoAgree but you are replying to a user named "lisper".
- CoastalCoder 2y agoMaybe he struggles with a speech impediment, you insensitive clod! </Slashdot_nostalgia>
- exe34 2y ago> It's a 600 page technical book > why don’t you just start reading it and decide for yourself? A journey of a thousand miles....
- Turing_Machine 2y ago> It's a 600 page technical book You do understand that you don't have to read an entire book before forming an opinion, right? > sort through everything that exists "Book that has been considered a classic for forty years and was used as the intro text at MIT for decades" is a long, long way from "everything that exists".
- iungret 2y agoI want a searchable resource where I give my inputs and desired output and brief description of the algorithm and it gives me the algorithm and code. Same with AOCP, but I greatly prefer scheme to MIX. Otherwise these works just seem like a doomsday rebuilding references rather than knowledge with any practical presentation.
- omnicognate 2y agoSICP isn't an algorithms book or a reference. It's very unlike The Art of Computer Programming.
- MrVandemar 2y ago>I want a searchable resource where I give my inputs and desired output and brief description of the algorithm and it gives me the algorithm and code. It sounds like you'd like to outsource your problem solving and thinking. Some things require work, and from that you learn and grow, which is the greatest reward.
- edjalascha 2y agoI think your searchable resource is called a "software engineer".
- dswilkerson 2y agoI used to be a teaching assistant for CS 61A (intro to programming) at Berkeley teaching from this book with Brian as the instructor. One of Brian's primary points is the following: > Scheme ... has a very simple, uniform notation for everything. Other languages have one notation for variable assignment, another notation for conditional execution, two or three more for looping, and yet another for function calls. Courses that teach those languages spend at least half their time just on learning the notation. In my SICP-based course at Berkeley, we spend the first hour on notation and that's all we need; for the rest of the semester we're learning ideas, not syntax. Bullshit. Again, I was a TA for this course. You do not spend the rest of the semester on ideas, you spend the rest of the semester on the students being very confused. This "everything looks the same" property of Scheme and of all LISP-like languages is a bug, not a feature. When the semantics is different, humans need the syntax to be different. In contrast, LISP/Scheme make everything look the same. It is quite hard to even tell a noun from a verb. This makes learning it and teaching it hard, not easy. Brian is selling a fantasy here. If you think Scheme is so great, look at this nightmare of examples showing the various ways to implement the factorial function in Scheme: https://erkin.party/blog/200715/evolution/ https://erkin.party/blog/200715/evolution/ All of this "abstractions first, reality second" agenda is just a special case of what I call "The Pathology of the Modern": the pathological worship of the abstract over the concrete. Everything modernism touches turns into shit. I am done with living in modernist shit and I hope you are too.
- Turing_Machine 2y ago> It is quite hard to even tell a noun from a verb What? Unless the list is quoted or something, the first item after the opening paren is always the "verb", yes?
- troad 2y agoThere's nothing stopping any other item from being a verb, no? (Not the verb, but a verb.) Anything involving higher order functions?
- 2y ago
- rscho 2y agoPeople who complain about parentheses have never tried structural editing. Change my mind!
- pas 2y agoI tried Racked with the recommended IDE setup (VScode), does that have structural editing? Here are my notes from 2023-07: https://docs.racket-lang.org/more/index.html https://docs.racket-lang.org/more/index.html * okay, seriously. functional programming is nice, but these fucking parenthesis are ridiculous. the VSCode extension is okay, but doesn't help at all with formatting, etc. * "car" and "cons", yeey, but "first" would have been so hard? * the whole "define x 'x" is also meh. * no return, so sometimes something just takes the last one and returns. * there's string->url ... why not string->parse-url .. no, would have been too verbose. MAYBE YOU COULD HAVE SAVED SPACE BY OMITTING THE FUCKING PARENTHESES * / end notes ehehe ... well ... I think I will keep trying it again every few years. is there a pythonish version, where indentation matters and no need for wrapping parens?
- Jtsummers 2y ago* there's string->url ... why not string->parse-url .. no, would have been too verbose. MAYBE YOU COULD HAVE SAVED SPACE BY OMITTING THE FUCKING PARENTHESES string->url is consistent with the way they do things in Racket. Note in that same document you linked the use of number->string and string->number, the -> indicates a type conversion. Along with string->url there is also the reverse, url->string, and some other conversion functions. That consistency is actually pretty nice, it means you can guess and check ("I have a string and want a url, will this work?" Oh, great it does!) or guess and search the docs before checking with the REPL or whatever. https://docs.racket-lang.org/net/url.html https://docs.racket-lang.org/net/url.html * "car" and "cons", yeey, but "first" would have been so hard? car shows up once, cons not at all, but he does use cdr. first, second, and rest are available, I don't know why he didn't use it in this demonstration. If you want to use first, go for it.
- ashton314 2y agoDrRacket probably would have served you better. That or Emacs. You might be interested in Rhombus: Racket with ML-inspired syntax. https://docs.racket-lang.org/rhombus/index.html https://docs.racket-lang.org/rhombus/index.html
- Ozzie_osman 2y agoAnd here i thought the goal of SICP was to scare off folks who were getting into CS because it was trendy rather than because they enjoyed it... Seriously, it was a really valuable foundational course. But 100% it scared some folks to other majors.
- gsbcbdjfncnjd 2y agoWith a 50% fail rate, I think the standard course load does a very good job of that anyway.
- Izkata 2y ago> And here i thought the goal of SICP was to scare off folks who were getting into CS Well, the acronym is pretty close to SCP...
- userbinator 2y agoIt's an interesting text for sure, and even became a bit of a meme, but I think SICP has only contributed to the trend of overabstraction and increasing inefficiency in software.
- alkonaut 2y agoI have never gotten past the first few pages. Had it ever been a mandatory class in my education, I would be working with something else today.
- bryanrasmussen 2y agoI always found the first half of the book a light read, an exciting read, it was as wonderful to read for me as Lord Dunsany, I sped through it. When it started to get to object orientation I started having problems following. It just didn't make sense. Maybe I should try again, but it just always made me feel that for my particular mind functional thinking was better.
- adityaathalye 2y agoFrom personal experience, I can say a person can build a fruitful bread-and-butter earning programming career on the first two chapters of the book, provided you solve literally all the exercises. Such is the density of know-how and design context packed in there. This also makes the book a challenging read. I feel like the math-y content is also not for everyone. After all, it was aimed at MIT engineering undergrad students who are expected to have a baseline mathematical felicity well above the average high school level.
- llm_trw 2y agoI find the difficulty of the chapters goes as the square of their number. Viz. Chapter 5 is 25 times as hard as chapter 1. I also find that basically no one goes past chapter 4. I've only ever seen one good talk on it and the guy was so far down the esolang rabbit hole that he had an IBM apl keyboard.
- bear8642 2y agoNot sure I'd call APL an esolang - it's just an old language focused on array manipulation like you'd find in numpy
- llm_trw 2y agolife ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵} https://aplwiki.com/wiki/John_Scholes%27_Conway%27s_Game_of_Life https://aplwiki.com/wiki/John_Scholes%27_Conway%27s_Game_of_... I'm not sure how you don't call that an eso lang.
- lycopodiopsida 2y agoCan someone compare it to PAIP? I assume SICP handles functional programming ans CS basics and PAIP is more about programming practice in general?
- citizen_friend 2y agoSimilar themes. SICP is a little more academic. You build a compiler, do more math, etc. PAIP also focuses more on Common Lisp specifics.
- Jtsummers 2y agoDifferent audiences too. SICP is meant for first year college students with little or no CS or programming experience. PAIP assumes no Common Lisp experience, but it's not an introductory text for CS. It's an introductory text for GOFAI and Common Lisp.
- lispm 2y agoThough, PAIP covers a lot of SICP content, but differently. It also includes implementations of programming languages. PAIP is only partly an introductory text to Common Lisp, it's more about actual software design and development with Common Lisp. IMHO PAIP is extremely well written. Book and Code: https://github.com/norvig/paip-lisp https://github.com/norvig/paip-lisp SICP has a mixed reception. Many find it excellent, others find it to focused to teach CS concepts in a math-oriented way. Thus there have been written several alternatives to SICP, using Scheme, Logo, other Functional Programming Languages, ... I think it's a great book, with a lot of excellent books written as a reaction to it.
- runlaszlorun 2y agoIn addition to the free book online, YouTube has original lectures from the early 80’s- complete with quirky humor, super early attempts at graphics, and late 70’s fashions all around. Oh,and educational too!
- wiz21c 2y agoAnd the best introductory lesson ever where they explain you what is programming.
- EncomLab 2y agoProf. Abelson's original lectures are available on YouTube and WELL worth the time to watch. It's unfortunate that this type of granular understanding of CS is seemingly not taught anymore - might help dampen down the hype cycles of late which equate a computer to a divine being of limitless potential instead of a dumb box full of switches.
- dartos 2y agoMy favorite class in college was my fundamentals of computer systems class. It finally clicked how assembly instructions could draw images on a screen and all the magic inside my computer vanished instantly. Big fan of dumb switch boxes
- Marazan 2y agoThe best lesson I took from SICP (which I read years after Iw as a competent programmer) is that the very moment you write your first function you are in effect creating a DSL for solving you domain problem. It truly levelled me up as a programmer when I was hit with that insight.
- classified 2y ago> most introductions to computer science use whatever is the "hot" language of the moment... So the coming introductory courses will use JS + LLMs?
- treprinum 2y agoI would never get into programming if all I was shown were some quixotic features of Scheme I couldn't use for anything in the real-world. What attracted me to programming was to quickly enable me how to draw a graph of a function, how to make a simple worm-like game, how to dream about creating a flight simulator and drawing the plane dashboard with all its dials and make them move even if the flying part was deep in dreams, drawing a car on a screen with some air arrows to simulate aerodynamics and dream how to build a software for it. But dry string manipulation with weird syntax was not very interesting and in fact rather repulsive.
- braden-lk 2y agoQuixotic features like functions and variables. Edit: Sorry, was cranky from being hungry. I take issue with “useless in the real world.” The first chapters introduce variables, functions, recursion, and lambdas, and not much more than that. That’s the beauty of the book. Flexible ideas that are immensely useful and form a great foundation for learning computing. It’s not the best total beginner book, I’ll admit, but it’s a great beginner-intermediate book for those who seek mastery.
- skybrian 2y agoThis seems like a misunderstanding of what other people find limiting. The problem some people have with this book is that it’s about computing in isolation. Scheme is an island with text-based I/O (as far as the textbook is concerned). You interact on the command line and do calculations. The ideas you learn about are deep, but internal, disconnected from other systems. There are engineering problems, but they aren’t about building systems, they’re about doing calculations or simulating systems using math. Functions and data structures and a bit of text data is all there is. This is great in its own way, but nowadays, there’s a preference for a programming course that’s more extroverted, that lets you build interesting things by including a program as one component of a larger system. I believe even MIT switched to an introductory course where they program robots using Python, or something like that?
- braden-lk 2y ago
- yencabulator 2y agoFWIW the book has moved to https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/index.html https://mitp-content-server.mit.edu/books/content/sectbyfn/b... The old url at http://mitpress.mit.edu/sicp/full-text/book/book.html http://mitpress.mit.edu/sicp/full-text/book/book.html is now 404, and most of what you find on that site will try to get you to do an "eTextbook rental".
- dualogy 2y agoApart from another HTML rendition, there's also an e-reader-ready epub rendition (from the HTMLs obv.) at https://github.com/sarabander/sicp?tab=readme-ov-file#sicp https://github.com/sarabander/sicp?tab=readme-ov-file#sicp
- boppo1 2y agoIs the 'How to get Scheme' still appropriate even though it was last updated in 2003?
- yencabulator 2y agoAre you asking whether the "MIT/GNU Scheme" project is still viable? The last release is from January 2023. Seems fine enough for learning. https://www.gnu.org/software/mit-scheme/ https://www.gnu.org/software/mit-scheme/
- boppo1 2y agoI'm asking if it works well for reading SICP, i.e. the solutiins are the same.
- 1n3nt0r 2y agoSadly my first exposure to programming was in FORTRAN on a mainframe (when I took a summer course at a college in 8th grade). I could not initially make heads or tails out of fortran or the imperative approach, but I knew it was magical. Eventually bought a VIC-20 and other computers later. By the time I was ready to start college was well versed in a number of (imperative) programming languages, data structures, algorithms, etc. However was exposed to SICP in college and fell in love with both the book and emerging functional languages (this was the late 80s). SICP remains my favorite CS / programming book of all time.
- mk12 2y agoI've slowly been working through SICP, currently on chapter 3: https://mk12.github.io/sicp/ https://mk12.github.io/sicp/. There are lots of other websites, but what sets mine apart is the exercise solutions are written as modules with explicit dependencies on other parts of the book, and they are tested in three Scheme implementations. I describe my approach for this here: https://mk12.github.io/sicp/exercise/language.html https://mk12.github.io/sicp/exercise/language.html.
- systemBuilder 2y agoI had been programming profesionally for 3 years (since age 15) when I took "SICP" at MIT in 1980 (we used LISP; Scheme would come a few years later). The course is designed to appeal to the ego of the professors who teach it, and it is designed to mold MIT students into AI researchers which is the whole point of the MIT curriculum - - 1. They taught a bunch of extremely advanced concepts like infinite lists of prime numbers where the 'CAR' and 'CDR' functions could be used to iterate down the list, which calculates the next prime number on-demand. 2. At the end of the course, they made the horrific mistake of encouraging students how to write their programs in LISP and then embed the LISP code into other languages, such as Algol, which produces the most extreme spaghetti code in the history of mankind! The problem with SICP is that it teaches many advanced language concepts but the students are unprepared to absorb them and haven't ever struggled with the types of problems these advanced concepts are meant to solve! It's like showing a peasant farmer how to drive a modern combine before they've ever tried ploughing their field with a horse plough! I can pretty safely say, as a systems programmer, I have used exactly zero of the concepts taught in SICP back in 1980. But most importantly, when professors teach SICP, they can feel good about themselves because they get the misguided impression that they are teaching something that grows their student's capabilities as a programmer and when talking to other professors teaching introductory computer science, the SICP professsors can say, "look at this cool shit my students did - i bet your students wish they could write shit as cool as this!" - end of story. Incidentally, I never went to class and got an "A" in the class. It was annoying to have to take this remedial brainwashing class after already taking 2 other CS classes (including introduction to programming and assembly language programming) at the University of Illinois.
- braden-lk 2y agoThis book kicks ass. Ignore the incurious.
- jedberg 2y ago> We'll find out pretty soon whether the course can survive my own retirement. > > (Footnote: Nope. Berkeley's new first course for majors uses Python...) This is the saddest part of the whole post. Taking the intro course in Scheme set me on a path of thinking about computing in a whole new way. While they try to teach the same concepts with Python, it's just not the same thing as using a truly functional language. A huge loss for Cal students for sure.
- surfingdino 2y agoIt is a good book for someone who is familiar with programing computers. It is not the best way to introduce the concepts behind writing software to someone who has never written a computer program. The very beginning does the book disservice > A computational process is indeed much like a sorcerer's idea of a spirit. It cannot be seen or touched. It is not composed of matter at all. However, it is very real. It can perform intellectual work. It can answer questions. It can affect the world by disbursing money at a bank or by controlling a robot arm in a factory. The programs we use to conjure processes are like a sorcerer's spells. They are carefully composed from symbolic expressions in arcane and esoteric programming languages that prescribe the tasks we want our processes to perform. Not everyone appreciates that kind of language and the suggestion that software development is some kind of alchemy that can only be understood by the chosen ones is the kind of bullshit that makes people loose interest. It actually projects an amateurish not professional image of the profession. I always found the SCIP crowd unbearable. Which is sad, because there is good information and solid knowledge in that book.
- borski 2y agoThere is a lot of “we’re nerds, and we own it” in that book. I suspect it was at least somewhat a response to the contemporaneous “ewww computer nerds are the worst kind of dweeb” nonsense that was happening in schools in the 90s. Personally? I love how it’s written. I find it clever, engaging, and that it uses clever analogies and examples, with a theme running throughout. The little comics provide some levity as well. I guess, to me, thinking of programming as alchemy effectively levels the playing field a lot. It means nobody is “born with it,” unlike looks or a straight nose or anything like that. It’s all about learning. That’s how I read it, anyway. Amateurish? Maybe. But, and this is important: we were all amateurs and it’s an intro to CS book. By definition, the people reading this book should be amateurs.