Part of the point of SICP is to be generic about its programming principles. The core principles and concepts are independent of any particular programming language (so long as it has first class functions, and probably a few other common features). Since Scheme has virtually no syntax it was an ideal language for Ableson & Sussman’s course. It’s notable that SICP spends hardly any time teaching the language.
I’ve never understood, therefore, the motivation behind trying to “translate” SICP into a language like JS (or Python, etc.) It over emphasizes the importance of the preferred language in a way that very obviously undermines the book.
The point being: if you’re gonna do SICP do it in Scheme. You’ll get more out of it.
The JS version of the book (I still bought it when it came out) is just weird. It has you writing JS in a non-idiomatic way that you'd never see (nor should you be the person introducing) in the industry. SICP teaches a very LISP-y way of thinking through problems. It's not that you CAN'T apply these tactics in other languages... they're just far more "at home" in Scheme/DrRacket/heck... even Clojure.
I have both books. Scheme for sure! Env setup can be a bit of an issue but it is doable. Regarding it, I remember having some weird issues with MIT Scheme on a modern computer, but Racket/DrRacket works well.
I'll add another recommendation for Scheme. The concepts in SICP map very well into Scheme, whereas I can only imagine them being awkward and non-idiomatic in JS. There's lots of passing around first class functions and use of recursion.
One of the two professors (Dr. Sussman) that give the lectures in this series is a co-creator of Scheme.
> I can only imagine them being awkward and non-idiomatic in JS
You don't have to imagine, you can look at the code used in the JS version and it goes through some fun contortions to get around the fact that JS is not expression oriented (like Scheme). This is from page 35 (PDF: https://sicp.sourceacademy.org/sicpjs.pdf):
The JS code has to use the ternary ?: to get around the fact that it does not have a good equivalent to `cond`. You can see that they've gone through a literal translation of Scheme to JS that results in very unidiomatic JS code.
Part of the point of SICP is to be generic about its programming principles. The core principles and concepts are independent of any particular programming language (so long as it has first class functions, and probably a few other common features). Since Scheme has virtually no syntax it was an ideal language for Ableson & Sussman’s course. It’s notable that SICP spends hardly any time teaching the language.
I’ve never understood, therefore, the motivation behind trying to “translate” SICP into a language like JS (or Python, etc.) It over emphasizes the importance of the preferred language in a way that very obviously undermines the book.
The point being: if you’re gonna do SICP do it in Scheme. You’ll get more out of it.
The JS version of the book (I still bought it when it came out) is just weird. It has you writing JS in a non-idiomatic way that you'd never see (nor should you be the person introducing) in the industry. SICP teaches a very LISP-y way of thinking through problems. It's not that you CAN'T apply these tactics in other languages... they're just far more "at home" in Scheme/DrRacket/heck... even Clojure.
I have both books. Scheme for sure! Env setup can be a bit of an issue but it is doable. Regarding it, I remember having some weird issues with MIT Scheme on a modern computer, but Racket/DrRacket works well.
Scheme. Javascript is a fine language, but it is not the right tool for this job.
I'll add another recommendation for Scheme. The concepts in SICP map very well into Scheme, whereas I can only imagine them being awkward and non-idiomatic in JS. There's lots of passing around first class functions and use of recursion.
One of the two professors (Dr. Sussman) that give the lectures in this series is a co-creator of Scheme.
> I can only imagine them being awkward and non-idiomatic in JS
You don't have to imagine, you can look at the code used in the JS version and it goes through some fun contortions to get around the fact that JS is not expression oriented (like Scheme). This is from page 35 (PDF: https://sicp.sourceacademy.org/sicpjs.pdf):
}That certainly works, but it's awkward. Here's the Scheme code from the 2nd edition of SICP:
The JS code has to use the ternary ?: to get around the fact that it does not have a good equivalent to `cond`. You can see that they've gone through a literal translation of Scheme to JS that results in very unidiomatic JS code.I‘d go with Scheme. You‘ll learn the basics in a day. The language spec is only a few pages. And Scheme reads like pseudo-code with parentheses.