views:

1792

answers:

16

I've caught the bug to learn functional programming for real. So my next self-study project is to work through the Structure and Interpretation of Computer Programs. Unfortunately, I've never learned Lisp, as I was not a CS major in college.

While SICP does not emphasize the tools for programming, doing the exercises entails picking a Lisp-like language to use. It seems like some implementation of Scheme would be the path of least resistance. On the other hand, I hear of others who have used Common Lisp and Clojure. It seems to me that Common Lisp or Clojure would be more likely to be used in production code, and therefore slightly better for my resume. BTW, I fully get the argument that learning a language is worthwhile for its own sake, but learning a language that helps my resume is still a benefit. I'm a capitalist and an academic about my learning.

If you had to self-study SICP, which language would you pick and why? Ideally, I would like to use a language that can run on the JVM. I can certainly work with a language where REPL works with bash and emacs.

ADDITION: have any of you tried reading SICP without using Scheme? If so, what was your experience like?

+25  A: 

Use Scheme. It is one of the simplest and easiest languages in existence, and you will spend very little time learning enough of it to understand SICP. Once you understand SICP, you will see how the concepts apply in any language.

Glomek
+2  A: 

The code in the book is Scheme so you'll have to read it anyways - you might as well write it. You might even like it!

Kyle Cronin
+18  A: 

Use DrScheme. As others have said, Scheme is a simple language, and DrScheme is a great environment to use it in which has a lot of support and mediocre-to-good documentation.

Claudiu
Downloaded it last night, and its UI looks super simple to use.
Alan
Alan, don't forget to use the SICP support available from PLaneT (user contributed libaries for PLT Scheme/DrScheme).http://planet.plt-scheme.org/package-source/neil/sicp.plt/1/13/planet-docs/sicp/index.html
soegaard
+1  A: 

I've caught the bug to learn functional programming for real.

From what I've heard, SICP is about a lot more than just functional programming.

grettke
A: 

but learning a language that helps my resume is still a benefit.

You should try using VB6 or COBOL, then, as there is a lot of billing work out there for it.

grettke
Yes COBOL programmers will still be needed, but ... this is a question about functional programming not about COBOL.
Alan
@Alan: I'm guessing that this reply was meant as sarcasm :)
Ovid
+1  A: 

Caveat: I have not read the whole book

Since the examples rely on closures and continuations, you would be better served by using a language with both of those features, otherwise you would need to implement them yourself.

For example, writing a metacircular evaluator in Scheme leverages the fact that Scheme provides closures and continuations.

grettke
IIRC, continuations don't really make a prominent appearance in the book.
Kyle Cronin
+1  A: 

I hear of others who have used Common Lisp and Clojure.

You should use whatever language most motivates you, but 99% of folks working through SICP are going to use Scheme.

grettke
+1  A: 

I used lua when I had a look at sicp

works out pretty well

Keith Nicholas
+3  A: 

To get real value out of the book you'll have to use Scheme. Which implementation of scheme depends on your current environment:

Windows - Dr Scheme (PLT Scheme) - http://download.plt-scheme.org/ Linux - If this is a remote account - you may consider MZScheme (PLTScheme) (http://download.plt-scheme.org/) otherwise you'll want to use Dr Scheme if this is a local instance of Linux.

hawkeye
+1  A: 

I think Clojure fits what you want to do just perfectly. It's much more functional than Scheme because the data structures are immutable and it can be very useful as it runs on the JVM. But, be aware that you'll end up learning Scheme anyway to be able to understand the code in the book.

J. Pablo Fernández
+1  A: 

I agree that you should just use Scheme. However, if you really have the itch to use Common Lisp or Clojure, I'd pick the latter. Scheme and Clojure are both Lisp-1s, so the code in the book will be more congruent between the two (except for tail calls, but if you understand how to compensate you'll be fine). Common Lisp is a Lisp-2 and will probably obscure the beauty of what SICP is trying to teach you.

Drew R.
By the way solve the tail-calls optimization problem in Clojure is recur: http://clojure.org/special_forms#toc10 (and to ask Sun to implement them in the JVM, where they should be)
J. Pablo Fernández
A: 

Use anything but scheme.

While using something else then scheme, you will be encouraged to think more, and avoid temptation to just retype the examples. It is a good thing.

Of course, it has to be similar enough, in lisp-1 sense, so clojure and arc are good to go.

Dev er dev
I disagree. Maybe that might be true with other textbooks, but I've personally found SICP's exercises to be much more than simply copying an example earlier.
Kyle Cronin
I agree with nobody.
Tim
I think it goes both ways, there's something to be said about using Scheme to stick close to the source, but switching to something a bit different but with similarities (another lisp dialect) does make you consider problems in different ways.
Runevault
+6  A: 

Not a direct answer but I expect this information to be useful for anyone working through SICP. Be sure to have a look at the videos here:

http://swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/

There are 20 episodes of an hour each. They were presented by Abelson and Sussman in 1986 for Hewlett Packard employees. I put them on my iPod and watched them while commuting. Fascinating.

Also, the full text of the book is available online at http://mitpress.mit.edu/sicp/

Drew Noakes
+3  A: 

As someone who hires people, I'll tell you that having Scheme on a resume is a good thing. Having Scheme, SML, Ocaml or Haskell on your resume suggests you are a very well rounded programmer, and quite a thinker.

That said, if you are trying for functional programming, why not Haskell instead? Scheme is multiparadigm, it can be OO, Funcitonal, Streams based, or anything else under the sun. This makes it awesome to try out new programming styles and paradigms, but if your goal is strictly functional, it can be a problem. (You will end up writing non functional code and not realizing it.)

Jonathan Arkell
A: 

I worked through (most) of it earlier this year, and used Common Lisp, simply because I didn't have Scheme available (don't ask).

As has already been noted, Scheme is a Lisp-1 language whereas Common Lisp is a Lisp-2. There are enough differences between the languages to mean that you have think carefully about translating the code in the book, so it forced me to really get to grips with the material.

inglesp
A: 

I have used scheme for my self-study. The best way to learn from SICP is to do all the exercises relegiously.

I have used Gnu guile for scheme.

weima