Open-Source High-quality PDF of SICP
github.com
github.com
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.
EDIT: Please state where in the legalese of the CC-BY-SA license that such would be disallowed.
Probably dissimilar in what way? I see them as legally similar. The only difference I see is GPL says 'this License" where CC-BY-SA says 'same or similar license.' GPL looks similar, ergo, GPL is fine.
This is not to say that literary works should be distributed under the GPL- the GPL is intended for computer programs. Perhaps the creator of this repository misunderstands this. Perhaps the repo contains computer code that performs the transformation and his intent is to place the computer code under GPL.
Regardless of these other issues, I still do not see a fundamental difference that prevents a derivative of a CC-BY-SA work being placed under GPL.
The FSF also thinks they're incompatible: http://www.gnu.org/licenses/license-list.html
Is it different now? (Not that SICP is heavy on math...)
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.
Quite a bit of SICP would be awkward to translate into a language that doesn't support TCO, such as Clojure.
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)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.
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.
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... which is aimed at sand-boxing (and looks like an interesting if not efficient idea) and 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).
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.
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).
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.
> 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.
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.
>> Clojure doesn't have implicit tail call but it does have loop-recur and trampoline. SICP can be followed quite easily in Clojure.
>>> 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.
This is the scheme implementation:
(define (factorial n)
(fact-iter 1 1 n))
(define (fact-iter product counter max-count)
(if (> counter max-count)
product
(fact-iter (* counter product)
(+ counter 1)
max-count)))
And this is the analogous(but not idiomatic) clojure: (defn fact-iter [product counter max-count]
(if (> counter max-count)
product
(recur (* counter product) (inc counter) max-count)))
(defn factorial [n]
(fact-iter 1 1 n))
There are no heavy modifications.> Besides that, basically the section's goal is to explain TCO.
def fact_iter(product, counter, max_count)
return product if counter > max_count
fact_iter (counter * product), (counter + 1), max_count
end
def fact(n)
fact_iter 1, 1, n
end
Now Ruby doesn't have TCO. But how does it stop you from understanding TCO, and how to implement them if the runtime supports it?I read SICP some time ago, and didn't do all the exercises, but as far as I recall, chapters 1-3 can easily be followed in Clojure, Ruby, JS...
I disagree that the Ruby example is sufficient, though. Remember, SICP is intended as an introduction to programming. A chapter like this is useful to people who do /not/ understand TCO, recursion, and the stack already. Understanding it and using that knowledge to translate the exercises is different than having a shaky grasp lisp, scheme, and the "interpretation of computer programs"
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.
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/b...
Edit: it reminded me of this http://okcancel.com/comic/4.html
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).
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/
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/con...
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?
Also, yeah, read the entire thing! You could skip some sections, but I would advice you to mostly move linearly from the start.
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.
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.
In the the MIT class, you were expected to put in 15 hours a week for 14 weeks, which is the length of an MIT semester. I probably put in double that, because I loved the materials and exercises so much. (Due to my efforts I did get one of the very best grades in the class, out of 200+ students, but it wasn't necessary to work quite that hard to do well in the class. I'm sure that one could have learned a great deal with the recommendation of 15 hours.)
I'm sure that you can still get a great deal out of the book just by reading it carefully, and that would take a small fraction of the time that it would take to treat the book like a real class. But the best way to learn, of course, is always by doing!
P.S. Be sure to watch the lectures for the class, which are online, albeit in a somewhat abbreviated form. In fact, it might be best just to start with them, and see how you like them.