5 ms·
Does Clojure differ a lot from Scheme for what SICP teaches? Is there any benefit for studying the Clojure version of SICP, rather than the original?
by bernatfp 13y ago
Does Clojure differ a lot from Scheme for what SICP teaches? Is there any benefit for studying the Clojure version of SICP, rather than the original?
- vezzy-fnord 13y agoI guess you get to use the Java API, but overall I can't think of any reason to modify the SICP, regardless of everything. On the bright side, at least it's not JavaScript.
- mrbrowning 13y agoI think it depends on your level of experience. For someone who's a beginner to Clojure and functional programming but wants to use Clojure as their home environment for working through the concepts presented in the book, I suspect they would face some challenges translating the semantics of certain examples in the book, such as streams, to their closest Clojure representation. If you're primarily concerned with just working through the material in the book, you may not want to have to deal with that overhead straight away.
- nickik 13y agoSome the way clojure deals with things is diffrent, everything about state. Also SICP teach all kinds of concepts from the ground up, its really cool to learn and understand but it has no use other then your learning.
- rbanffy 13y agoIt may be a more useful language, as it integrates with Java libraries. However, there are significant differences between Scheme and Clojure and I'm not sure how well the SICP part survives the translation.
- nickbauman 13y agoBecause the JVM doesn't have tail call optimization, Clojure doesn't allow you to do many of the exercises in SICP the way they were intended to be done, so it misses the point of SICP. So for example: https://github.com/nickbauman/sicp/blob/master/src/section2_3_4/huffman.clj https://github.com/nickbauman/sicp/blob/master/src/section2_... You'll see I solved the exercise by ignoring what they were trying to teach because it can't be done in Clojure they way they were trying to teach it. I did learn how to make a tree with only lists, which is cool.
- dizzystar 13y agoYes, the differences are significant. The least reason is tail-call. The point is that Clojure is a very different language, abstracting many of the things that aren't abstracted in Scheme. The idea of the book (at least in my interpretation) is that you are given a language with the absolute bare-minimum needed to built programs, thus why you can "learn Scheme in an afternoon." All of these things like (filter), hash-maps, dicts, etc, that we use and take for granted in our programs simply do not exist in Scheme unless you build it yourself. In Scheme, you have to build up all the tools you need by creating your abstractions. To do this in Clojure (or any language) you have to ignore the abstractions you are given, and often must break the abstractions to create the abstractions you are already given. Think of it this way. If you are going to be learning how to create and explore algorithms for matrix multiplication, would you prefer to use Mathematica or Python without Numpy?