7 ms·
Open-Source High-quality PDF of SICP
- nessus42 14y agoO frabjous day! Callooh! Callay!
- PhearTheCeal 14y agoWhat dialect of Lisp should I use to follow along the book with?
- squidsoup 14y agoScheme of some sort ideally - either MIT Scheme or Racket will do nicely. I seem to recall that someone was working on a version of SICP with examples in Clojure, but it may be incomplete. http://racket-lang.org/ http://racket-lang.org/
- JoelMcCracken 14y agoYeah, the SICP in Clojure project died pretty early on. Quite a bit of SICP would be awkward to translate into a language that doesn't support TCO, such as Clojure.
- threepointone 14y agoPardon my ignorance, but why? I haven't read SICP, but I do consider myself to be pretty good at javascript, and was thinking of using it.
- mjdwitt 14y agoTCO refers to tail call optimization, which is a useful optimization for languages such as Scheme which encourage heavy use of recursion. TCO allows the interpreter to reuse the current stack frame when a tail-recursive[1] function calls itself instead of creating a new stack frame for each recursive call. Because javascript lacks this and many other features of Scheme/Lisp, I wouldn't really recommend using it for SICP. [1] Tail recursive functions are recursive functions which merely return the result of their recursive call to the caller instead of further processing those results before returning. In pseudocode: // non-tail expt(b, x): if x == 0: 1 else: x * expt(b, x-1) // tail-recursive tail-expt(b, x, ans): if x == 0: ans else: tail-expt(b, x-1, x*ans) For these definitions: expt(2, 3) == tail-expt(2, 3, 1)
- threepointone 14y agoI see; that makes sense. Thanks! A good reason to learn scheme.
- mjdwitt 14y agoGlad I could help. Scheme is great for introducing oneself to many concepts not commonly present or used in more common imperative languages. That, and the SICP is just a ton of fun.
- irahul 14y ago> Because javascript lacks this and many other features of Scheme/Lisp, I wouldn't really recommend using it for SICP. A language without TCO won't affect what you get out of SICP. Just assume JS is tail recursive. The first 3 chapters can be done(with some translation) in JS.
- ef4 14y agoTCO is an optimization, it doesn't affect correctness. So you can ignore not having it, until you run out of stack. There is a much bigger reason to stick with Scheme for SICP: all the meta-circular evaluator stuff where you learn to implement Scheme in Scheme. I supposed you could implement Scheme in Javascript, but then you'd still need to learn Scheme. And you certainly won't want to implement Javascript in Javascript.
- dspillett 14y ago>TCO is an optimization, it doesn't affect correctness. So you can ignore not having it, until you run out of stack. Correct. Though CPU performance is an issue that tail recursion optimisation addresses too. For simple functions building up the stack frames and deallocating them afterwards can be more work than the function itself. For deep recursion stack space is the problem you usually hit first, but for code with tight performance requirements no always. >And you certainly won't want to implement Javascript in Javascript. Oh I don't know, it could be an interesting project if only for an exercise in intellectual onanism! In fact I've heard of it being done a few times. The first ones that pop up in Google are http://sns.cs.princeton.edu/2012/04/javascript-in-javascript-js-js-sandboxing-third-party-scripts/ http://sns.cs.princeton.edu/2012/04/javascript-in-javascript... which is aimed at sand-boxing (and looks like an interesting if not efficient idea) and https://github.com/mozilla/narcissus/ https://github.com/mozilla/narcissus/ which has the stated goal of being used for experimentation with the language itself (so the fact it is implemented in javascript is probably less relevant).
- jlarocco 14y agoSICP is a book about programming in Scheme, so it heavily uses the features of Scheme. Most of the concepts covered are applicable outside of Scheme, but if you're going to work through the code, you're better off just using Scheme.
- threepointone 14y agoLooks like I might just do that. Thank you!
- irahul 14y ago> Quite a bit of SICP would be awkward to translate into a language that doesn't support TCO, such as Clojure. Clojure doesn't have implicit tail call but it does have loop-recur and trampoline. SICP can be followed quite easily in Clojure. It can very well be followed in Ruby or Javascript as well. No tail calls simply means the runtime won't be iterative. TCO are a very small aspect of what SICP teaches, and I don't see why absence of tail calls should stop anyone from following the book in their language of choice(at least the first 3 chapters).
- spacemanaki 14y ago> It can very well be followed in Ruby or Javascript as well. Regardless of TCO issues, I don't think this is a good idea, since you'd miss out on the real treasure of chapters 4 and 5, where using a Lisp lets the authors demonstrate interpreters and compilers without mucking around with parsing. You've obviously read it, so this is just advice for anyone considering reading it using some other language: Just use Scheme, the flavor that SICP uses is a tiny subset and it takes a single lecture from the videos for them to explain it.
- irahul 14y ago> since you'd miss out on the real treasure of chapters 4 and 5, > so this is just advice for anyone considering reading it using some other language: Just use Scheme, the flavor that SICP uses is a tiny subset and it takes a single lecture from the videos for them to explain it. I would say for anyone on the fence, use Ruby, JS... if you don't know scheme and aren't willing to learn it to read a book. By the time you will reach 4th chapter, you will already know enough scheme. The book doesn't assume prior knowledge, and since you are translating scheme snippets, you already are practicing scheme. I am not saying scheme is not the ideal language for the book; it is. I am just saying you can dip in your toes with the language of your choice.
- JoelMcCracken 14y agohttp://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html#%_sec_1.2 http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html... This section relies on TCO. I realize that it could be translated, but I do not feel that this could be done without heavy modification. Besides that, basically the section's goal is to explain TCO.
- ohgodthecat 14y agoMIT Scheme if you don't want to translate any of the code in the book. Another option is that racket-lang has a sicp dialect of scheme that you can put as the language which will also work especially if you use drscheme (or drracket now) which is pretty nice for those that don't want or use emacs.
- irahul 14y ago> What dialect of Lisp should I use to follow along the book with? Any dialect of lisp will do fine if you know the language. SICP uses Scheme which is a lisp-1 and mandates TCO. You can very well use lisp-2 viz. Common Lisp - you will have to do the translation for passing/calling function references, and your common lisp might not implement TCO. But none of it is required to follow the book.
- plafl 14y agoThe most complete and user friendly by a long margin is racket. I remember however some problems with set-car!/set-cdr! in doing the exercises. Maybe you will need to change the language to RSR6 with #lang
- takikawa 14y agoThe easiest way to use SICP with Racket is to use the sicp.plt package on the package repository: http://planet.racket-lang.org/package-source/neil/sicp.plt/1/17/planet-docs/sicp/index.html http://planet.racket-lang.org/package-source/neil/sicp.plt/1...
- squidsoup 14y agoLooks like there are epub and mobi versions out there as well. Great to see community efforts to keep this excellent book alive. https://github.com/ieure/sicp https://github.com/ieure/sicp (epub) https://github.com/twcamper/sicp-kindle https://github.com/twcamper/sicp-kindle (mobi)
- pooriaazimi 14y agoThis ePub version seems nicer. The original author (ieure) hasn't had an update for two years... This guy's fork is just two days old: https://github.com/Paladin/sicp/ https://github.com/Paladin/sicp/
- StavrosK 14y agoHere's the built version of that (it might have the proper cover, I'm not sure what Calibre did with the metadata), because I love you guys: http://www.sendspace.com/file/vio1m4 http://www.sendspace.com/file/vio1m4
- pooriaazimi 14y ago:) I came back to post the built ePub too! This one has the right cover; I tested it right now on my iPad: http://d.pr/f/5qg6 http://d.pr/f/5qg6
- nimrody 14y agoToo bad epub/mobi do not support nice typesetting of equations (except as images). At least this was the situation last time I checked. Is it different now? (Not that SICP is heavy on math...)
- splicer 14y agoI got a kick out of this: "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."
- baxrob 14y agoJust to note, it's even tastier with the videos: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures/ http://ocw.mit.edu/courses/electrical-engineering-and-comput...
- PhearTheCeal 14y agoIs there a higher resolution version of these? Or perhaps a copy with better sound?
- baxrob 14y agoYeah, I don't remember them looking/sounding so choppy. And the download looks as bad as the stream. I googled "sicp videos highres" and there's torrent on piratebay that appears to have larger video files.
- drostie 14y agoThe videos from the MIT site have always had choppy audio. Since they are Creative Commons I've sometimes contemplated creating a more modern version -- a project where I copy the text and programs word-for-word, then perform a screencast of the lecture myself with a more controlled audio setup. I might also change the language on the chalkboard but I imagine that would garner me more hate than love.
- AUmrysh 14y agoWhat would be interesting is to create an interactive lecture that uses the content and examples from the old Sussman lectures but presents it in a cleaner (text based/vector graphics) way with an interpreter built right into the lecture page.
- ufo 14y agoI remember that the old site had links to torrents of the videos you could download. However, I can't find them in the new site...
- ekanna 14y agoNice book. If someone can provide javascript version of examples, everyone can literally play with it.
- zokier 14y agoThe original SICP text seems to licensed with CC-BY-SA, and this PDF version has GPL license slapped on it. Is that legal? GPL is more restrictive than the original license after all.
- pygy_ 14y agoAFAIK, a file is not coverered under the GPL unless it sports a notice that says so. Putting the GPL in a directory doesn't render its content covered by the license. In this case, there's no indication in the files that they are covered by anything. The README clearly states that the texi source is CC licensed, though. So, even if the repository owner intended to release this under the GPL, his actions are void.
- AlisdairO 14y agoProbably, I'd expect. Derivative works under more restrictive licenses are usually fine (as long as this isn't explicitly disallowed) - it's making a derivative work under a less restrictive license where you're more likely to run into issues.
- IvarTJ 14y agoIt is explicitly disallowed by the share-alike clause.
- delinka 14y agoI need an explanation for this. I don't read the GPL as incompatible with CC-BY-SA. However, IANAL, so help a brother out? EDIT: Please state where in the legalese of the CC-BY-SA license that such would be disallowed.
- sirclueless 14y agoFrom the CC-BY-SA license[1]: "Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one." The GPL is probably considered sufficiently dissimilar as to make relicensing under it illegal, but IANAL either, so who knows. [1]: http://creativecommons.org/licenses/by-sa/3.0/ http://creativecommons.org/licenses/by-sa/3.0/
- barking 14y agoOT, I am not familiar with GitHub and I know it's much more than a download site. As a Download site, however, I don't think it's very user friendly. You think you've have what you want when you see the file icon but that isn't clickable. 'Raw' doesn't sound very good and neither does 'History' Then 'Downloads' link looks like a link to a more general page than the Download link for this file in particular. Through trial and error I found what I was looking for after not too long but it left me feeling a little stupid and irritated at the same time. Edit: it reminded me of this http://okcancel.com/comic/4.html http://okcancel.com/comic/4.html
- mnazim 14y agoGitHub is not a download site. It's a service that enables collaborative coding by providing hosting for your with git repositories. Think of it as a SourceForge of 2012(though, this could be a debatable topic).
- barking 14y agoSo I guess the theory is that most projects that are hosted on Github will have a product site somewhere else where ordinary users are presented with a simple download button
- chasingtheflow 14y agoSomething like that ...
- bjz 14y agoClick on the zip icon to download it: https://img.skitch.com/20120726-nd9jxi6gwa32tnkjxwrehewpcn.png https://img.skitch.com/20120726-nd9jxi6gwa32tnkjxwrehewpcn.p... You can also download it directly from the website if you don't want the source code bundled along with it: http://sicpebook.wordpress.com/ebook/ http://sicpebook.wordpress.com/ebook/
- jiggy2011 14y agoI actually bought the paperback of this but haven't got around to reading it yet. How long would it take someone of average programming skill (with no lisp/scheme background) to bang through this at say 4 hours a week? Is it even worth reading the entire thing as opposed to a few chapters?
- edwkar 14y agoIt's hard to approximate how long time you'll use, since it depends so much on what ideas you are familiar with, but I'd say that SICP is generally a nice and "easy" read for a programmer with some experience. I don't mean to say that the material is "easy" -- far from it, there's a lot of challenges and brain-twisters -- but the writing is IMO very good, and the book builds up nicely. You should also complement your reading by watching some of the videos of Abelson and Sussman teaching 6.001 (especially Lecture 1A, and Sussman's lectures on meta-circular interpreters). Also, yeah, read the entire thing! You could skip some sections, but I would advice you to mostly move linearly from the start.
- DannoHung 14y agoIt's pretty easy going until the last chapter, I thought. Maybe a month or two, depending on how much free time you have and how many exercises you decide to do. More if you're an exercise completionist. I only did the ones I thought sounded interesting, honestly.
- spacemanaki 14y agoI'm going to disagree with a sibling of my comment and suggest that you're not going to be able to "bang through this" at 4 hours a week over the course of a month or two. That comes out to 16-32 hours total, which is just a pitiful amount of time, less than a full time week of work. I just don't think so, unless you really are above-average. After all, it was the basis for many first semesters of CS at MIT, and most (even introductory) CS classes require more dedication than 4 hours a week, and are usually more like 10-12 weeks long. It does depend a lot on your background, because there are large sections of the book that rely on examples taken from electrical engineering and mathematics. These could be tough going if you aren't that familiar with calculus, complex arithmetic, or simple digital circuits. I think it's the biggest flaw in the book, and others have criticized this as well. That said, I really hope not to scare anyone off! You can skip things you struggle with and come back to them, but I do think at least reading the whole thing and attempting all of the exercises is really valuable (there are over 350 exercises, of varying difficulty). So I would try it out, read through the first chapter and see what you think. You may not find it as magical and wonderful as others have, but you might. And you have to ask yourself why you're reading it. You might find that you don't want to bang through it as fast as you can, just so you can tell your colleagues you read it. You might find that it opens up a whole world of alternative programming languages, interpreters and compilers, and it might just be the opening of the rabbit hole, that you won't find the bottom of for years. If that's the case, the great Lisp books: PAIP, LiSP, EOPL, AMOP ... they're all waiting for you. At least, that's what's happened to me.
- joelthelion 14y agoWhat would be awesome would be a nice EPUB version.
- kot-behemoth 14y agosquidsoup replied earlier (http://news.ycombinator.com/item?id=4294369 http://news.ycombinator.com/item?id=4294369) with this EPUB repo: https://github.com/ieure/sicp https://github.com/ieure/sicp
- peapicker 14y agoI, for one, would very much like to read an article about the preparation of this document and the various tools used in the toolchain, as well as the workflow -- it could serve as a primer for 'how to do ebooks' for the future that I would enjoy greatly. It looks like Inkscape for the SVG editor, and texinfo for the text, but I know enough to know it would be nice to know what if any special config was done to get the nice fonts, etc.
- derekp7 14y agoDoes anyone know how to make a smaller page sized PDF from this texinfo source? Specifically, I'd like to target the screen size of the popular 7-inch tablets.
- oinksoft 14y agoHave you looked at https://github.com/sarabander/sicp-pocket https://github.com/sarabander/sicp-pocket ?
- derekp7 14y agoAh, that looks like it could work. Only thing it needs is to have the code sections printed with a smaller font, cause many of them currently run off the screen (I see that they are still working on that part).
- gbog 14y agoI understand this is lisp version of SICP but heard the course is now taught with python. I searched and couldn't find this python version online though. Someone have some hindsight?
- ichthyos 14y ago6.001, the introductory CS course at MIT that used SICP, is no longer offered--it's been replaced with 6.01, a survey of EECS that uses Python. However, UCBerkeley has replaced its Scheme-based SICP class with a Python-based SICP class, CS61A, taught by John Denero: http://www-inst.eecs.berkeley.edu/~cs61a/fa11/61a-python/content/www/index.html http://www-inst.eecs.berkeley.edu/~cs61a/fa11/61a-python/con...
- rmk 14y agoThis is great! Thanks!
- ziffusion 14y agoAm I the only one who can't open this in Acrobat?
- cellularmitosis 14y agoI split this book up into chapters: http://jason.pepas.com/sicp/sicp-ebook-split-into-chapters/ http://jason.pepas.com/sicp/sicp-ebook-split-into-chapters/ by using pdftk: pdftk A=SICP.pdf cat A25-117 output SICP_chapter_1.pdf pdftk A=SICP.pdf cat A118-286 output SICP_chapter_2.pdf pdftk A=SICP.pdf cat A287-460 output SICP_chapter_3.pdf pdftk A=SICP.pdf cat A461-624 output SICP_chapter_4.pdf pdftk A=SICP.pdf cat A625-777 output SICP_chapter_5.pdf I then use some booklet-preparation software to turn it into booklets which I could print out at Kinko's, because I didn't want to have to haul around the entire book with me: http://jason.pepas.com/sicp/sicp-ebook-split-into-chapters/booklets/sicp_booklets.jpg http://jason.pepas.com/sicp/sicp-ebook-split-into-chapters/b...