11

I am a third year bachelor student in a software engineering program, and I brought up the idea of reading SICP to an adviser to gain a deeper and more fundamental understanding of the principles behind all this software we engineer.

He suggested not to learn Scheme to complete the book (because it's not as common as modern dialects of Lisp) but to do the exercises in Clojure instead.

It's an already difficult book, if I do attempt the book's exercises in the more modern Clojure, how would that work? For example, I can't find any real solutions, the syntax they teach for Scheme is different, etc.

14

In my first year at the university the first programming course I took was using SICP (that was 1988). However, I had a similar problem like you: for my own computer (actually a Commodore Amiga), there was no Scheme implementation available at that time, only a different Lisp dialect (I don't remember its name).

However, given the flexibility of Lisp, it was pretty simple to "emulate" Scheme syntax just by adding the missing lisp macros and functions in a few scripts. This was actually enough to implement all the exercises from chapter 1 to 3 required during the course (note that SICP does actually not require the full Scheme stack, a small subset is all you need).

So since Clojure is AFAIK a modern Lisp dialect, I guess you could just do something similar, which gives you the fully free choice to write things either in Scheme or Clojure or a mixture of both.

Of course, solving the exercises directly in Clojure will also be possible, both languages are very similar. More important, SICP is not about programming language syntax, it is about the right use of abstractions in programming (for example, with functions, data, and objects). So don't think too much of possible syntax problems, these are not in the focus of this book and most probably of minor concern.

  • 6
    The only issue I foresee is that clojure lacks 1. TCO (recur only handles tail recursion, not general calls) and 2. the lack of call-with-current-continuation which is needed for chapter 4. – jozefg Aug 19 '14 at 15:26
  • 2
    @jozefg: I think if the OP gets himself successfully through chapters 1-3, he will most probably at the point where he won't complain about the syntactical differences between Clojure and Scheme any more ;-) – Doc Brown Aug 19 '14 at 15:36
  • @DocBrown consider editing clarification about chapters 1-3 in your comment above into the answer (and possibly explaining the issues with chapter 4, if you agree with comment discussing these) – gnat Aug 21 '14 at 18:24
  • @gnat: the comment is surely correct, but IMHO a little bit nitty. The important part of my answer is the last paragraph. – Doc Brown Aug 21 '14 at 19:36
0

I found your question just after finding this site which looks like it is right up your alley (though you may have found it or an alternative in the intervening months): SICP in Clojure

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.