views:

610

answers:

4

If I want to learn Clojure, should I start by learning Scheme or Common Lisp?

Or is Clojure different enough from both of these, that I should just start learning Clojure by itself?

+6  A: 

For your purposes I think you are safe to just start learning Clojure. The differences between Lisp and Scheme (and Clojure itself for that matter) shouldn't be a concern especially if you are just starting to learn.

Andrew Hare
+10  A: 

It would be to your benefit to learn all three, if only so you can pick which one is best for your needs. All three have their own strengths and weaknesses.

Clojure is vaguely like Scheme in that it's a mostly-functional language and is a Lisp1. Clojure also borrows things from Common Lisp, like multimethods and macros, and people are always porting cool Common Lisp things to Clojure as libraries. The creator of Clojure was himself a Common Lisp hacker before writing Clojure. Clojure borrows a lot of terminology and conventions from Scheme and CL both (but also has its own flavors in many areas).

There is not a lot of literature for Clojure right now, it being such a new language (there is only one Clojure book so far). But there are loads of good Scheme-oriented books, like SICP and The Little Schemer / The Seasoned Schemer. There are also good CL books, like PCL, and many others.

Lisps also have a lot of history and it is to your benefit to understand the history, to see where and why Clojure deviates from it if nothing else.

I'd recommend starting with Scheme because it's the simplest language of the three and therefore easiest to learn. Then dabble in CL and Clojure until you have a handle on things, then go full-steam in whichever of the two you gravitate toward.

Brian Carper
Terrific answer. Thanks so much.
uzo
A: 

It depends on whether you want to focus on learning or playing. If you really want to study Lisp, Scheme is a good place to start. If you'd rather play as you're learning Clojure is a better fit.

Eventually I think Clojure might be a better learning language. It's support for concurrency is really eye-opening. Few languages make it so simple for a beginner to write concurrent programs.

dnolen
+1  A: 

My first Lisp learning experience was with Scheme, I've never touched Common Lisp (felt it was too complex), and am now starting on Clojure.

I used Dorai Sitaram's "Teach Yourself Scheme in Fixnum Days" to learn Scheme and got fairly far though I never really found myself wanting to use Scheme in real projects.

Clojure, because it purportedly gives nice, clean access to the huge universe of J2SE/J2EE libraries, on the other hand, encourages me to relearn this Lisp dialect because it may finally be of practical use.

As for which one to start with, I would say Scheme is simpler and so might be more appropriate to start with. On the other hand, if you have good Java and Python knowledge, you might not mind diving straight into Clojure because, unlike Scheme, it contains elements of these other two languages (e.g. data structures reminiscent of Python and JVM/Java API centric tutorials) and the familiar terrain might help.

Since I did come from all three (Java, Python, Scheme), I find myself in a good position to appreciate just what Clojure brings to the table that is different from Scheme. I'm no experienced Schemer, but I'd say that if you immediately start with Clojure, you will still get the general Lisp experience, so you definitely won't be missing that by forgoing Scheme.

andz