It is possible to use pretty much any decent Scheme system with SICP, but the language has changed since even the Second Edition, so I don't recommend it. That said, once you are working on your own projects, nothing stops you from using a different system, even though you might have to RTFM to see modern equivalents to ancient idioms.
Is there any way to clean them up?
I was just about to ask just that question?
Thank you, SM
unless you mean 'systems programming' as just 'the crap one does to try to glue together all the grotty pre-existing systems' and 'developing a good sense of taste about 3rd party libraries', in which case no, its not really very relevant.
although even here there is insight, I watched a video of Sussman describing why they were putting down SICP and demanding that MIT develop new introductory courses. he was so graceful and considered, putting his polished jewels away. the time when we could reasonably be expected to see across and through all the layers of abstraction was over.
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.
One of the two professors (Dr. Sussman) that give the lectures in this series is a co-creator of Scheme.
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):
function count_change(amount) {
return cc(amount, 5);
}
function cc(amount, kinds_of_coins) {
return amount === 0
? 1
: amount < 0 || kinds_of_coins === 0
? 0
: cc(amount, kinds_of_coins - 1)
+
cc(amount - first_denomination(kinds_of_coins),
kinds_of_coins);
}
function first_denomination(kinds_of_coins) {
return kinds_of_coins === 1 ? 1
: kinds_of_coins === 2 ? 5
: kinds_of_coins === 3 ? 10
: kinds_of_coins === 4 ? 25
: kinds_of_coins === 5 ? 50
: 0;
}That certainly works, but it's awkward. Here's the Scheme code from the 2nd edition of SICP:
(define (count-change amount) (cc amount 5))
(define (cc amount kinds-of-coins)
(cond ((= amount 0) 1)
((or (< amount 0) (= kinds-of-coins 0)) 0)
(else (+ (cc amount
(- kinds-of-coins 1))
(cc (- amount
(first-denomination
kinds-of-coins))
kinds-of-coins)))))
(define (first-denomination kinds-of-coins)
(cond ((= kinds-of-coins 1) 1)
((= kinds-of-coins 2) 5)
((= kinds-of-coins 3) 10)
((= kinds-of-coins 4) 25)
((= kinds-of-coins 5) 50)))
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.In reality you get lectures from individuals that became professors because they are great at politics/research but not at teaching (very different skill).
If you even get them and not their 25 year old assistants.
And this is apparently super common even in ivy league universities as Youtube lessons have shown me over and over.
Be thankful when you get the 25 year old PhD students & post-docs. They care more about teaching and remember learning the material recently and are more willing to talk & help you.
I think you have the “even” backwards. Elite research first universities have this problem more than teaching-first, low research output programs.
but I haven't gone through the video lectures or even all of SICP. but those that I did have had a lasting impact. particularly the erasure of the declarative/procedural dichotomy..thats been a very useful tool
Plenty of courses taught by brilliant individuals that were just bad at teaching or borderline not prepared.
Some courses (like biochemistry) were effectively useless as de facto you had to memorize 600 pages of Lehninger's book anyway. There's nothing to understand in the Krebs cycle.
I also vividly remember exams like advanced algebra were the professor genuinely did nothing but rewrite canned content on a board and could not really shed light on anything, you were on your own.
These twenty video lectures by Hal Abelson and Gerald Jay Sussman are a complete presentation of the course, given in July 1986 for Hewlett-Packard employees, and professionally produced by Hewlett-Packard Television. These videos are also available here under a Creative Commons license compatible with commercial use.
Note: These lectures follow the first edition (1985) of Structure and Interpretation of Computer Programs. Many of the programs discussed were rewritten for the second edition (1996) of the book, and new material was added. These video lectures will still be useful for students using the second edition, since the overall themes of the course and order of presentation are unchanged.
These videos are courtesy of Hal Abelson and Gerald Jay Sussman, and are used with permission.