views:

490

answers:

11

Hello! I am an intermediate programmer, and have decided to learn either common lisp or scheme. My question is simple, which one would you choose? I don't care much for the difficulty of the syntax, just the power, flexibility, and other aspects of the language itself. Also, which implementation of either common lisp or scheme should I choose? Thanks!

A: 

common lisp is a lot more useful, but scheme is a lot cleaner. mostly comes down to that.

sreservoir
+1  A: 

I have an affinity for the more pragmatic, baroque, and warty programming languages, so I selected Common Lisp.

I use GNU clisp, but I am considering changing to SBCL due to its focus on efficiency.

Paul Nathan
I definitely think SBCL is the better of the two... not just because of efficiency.
kotlinski
@kotlinksi: Why?
Paul Nathan
+1  A: 

I chose Scheme because it was the language taught in Structure and Interpretation of Computer Programs. It's been a fun read so far.

Bill the Lizard
That is a fantastic book. Unfortunately there are also some excellent books that use CL (PAIP, AMOP) so this doesn't *necessarily* make the decision much easier. :-)
Ken
+2  A: 

My impression: Common Lisp is more for getting stuff done, Scheme is more for education and fun. I prefer the SBCL implementation. Scheme, I don't know.

kotlinski
I used to believe that, then I started using Guile.
Joel J. Adamson
...and then what happened? Not as much fun as Common Lisp? :-)
Ken
+4  A: 

If you want power and flexibility you go with Common Lisp.

If you want clean and simple you go with Scheme.

So far I'm happy with SBCL.

David Thornley
+9  A: 

Like so many things, it depends on what you want to do.

Remember, if you choose one now, it doesn't preclude you from changing later. In fact, I found it quite easy to switch from knowing a little Scheme to learning a lot of Clojure.

If you just want to learn, and play around with a Lisp, or even build moderately complex programs, I'd say Scheme is probably a better bet. It's got a cleaner, crisper (smaller) standard library, and there are a lot of resources out that that cater to the learner (not that there aren't for CL, either).

If you want the raw power of tons of libraries (many very well written) and the toolkit of a standard (as standard as a CL implementation gets) library that comes with a CL, then it'd be your better bet.

Alternatively, I'd suggest Clojure. It's a relatively new language (< 5 years), but it's got a lot going for it. It's built for concurrency, with plenty of primitives that make it easy to write state-safe programs if you need to have state. And plenty of other perks, though again, the standard library manages to stay small.

It's also on the JVM, so you have access to all the libraries you would if you were using Java, should you need any of them, plus the raw speed that the JVM has to offer is at your fingertips.

However, it is a new language, with a new (but very friendly!) community. If you just want to dip your toes in the pool of Lisp, I'd say Scheme is your best bet. If you want to get things done, my preference and my love is Clojure.

EDIT Honestly, you can't go wrong with any of the three. One may be better depending on what you want to do, and I'd recommend Clojure to just about anyone.

Isaac Hodes
Thanks for the help! I will start off with Scheme, then move into either Clojure or Common Lisp.
Sounds good! You'll have fun. I'd recommend PLT Racket for your Scheme dialect. http://racket-lang.org/
Isaac Hodes
+1  A: 

I usually view it like this: Common Lisp is to Scheme as C++ is to Python. With both Common Lisp and C++, you're given a huge load of tools and lots of power and essentially allowed to roam free. With Scheme, on the other hand, there's more of a focus on simplicity and you're given a little bit less rope to hang yourself by.

And just like with C++ vs. Python, there's this idea that one is for real, grownup projects while the other is sort of a toy language to play around with or create throwaway scripts, even though in most cases the "toy" is good enough for whatever you need to do.

If you want to look at Scheme, I recommend PLT Racket. It's not strictly standard Scheme, but it's essentially the same and it's a "batteries included" distribution.

Chuck
+2  A: 

This is an old one ;) Emacs or vi? KDE or Gnome? Red or White?

The biggest difference between the two is that Scheme tends to focus on functional programming; some authors stress functional programming in Common Lisp, such as Paul Graham, and if I write Common Lisp, I follow their advice.

I tend to prefer Scheme since it just makes more sense to me. I've found that the Scheme community, particularly surrounding free software implementations, is much more focused on free software. Consider that if it's important to you. Contrary to popular belief, Common Lisp is a very popular language, but it's most behind closed, corporate doors. That was a big factor for me to turn away from Common Lisp: when the community's not as open, you're not going to find as much in the way of help and libraries.

As far as implementations, I would recommend Guile if you're a GNU/Linux user. Other implementations are just too far outside the mainstream of GNU-consciousness; I like the GNU community, so Guile was the best choice for me. Also Guile has the best set of libraries included in the default installation that I've found (considering that different from the other respondents I know nothing about Clojure).

I've seen some other respondents repeating the old incantation "If you want to get something done, use Common Lisp; if you want to learn, use Scheme." That was probably true in the era of SICP, but I don't think it's true these days. A good implementation of Scheme, like Guile, has tons of libraries available and has plenty of good use-cases that show you can get plenty of stuff done with it.

Joel J. Adamson
A: 

Scheme is of equal or greater power of Common Lisp, but it doesn't have as much support or bindings. I'd go with Common Lisp. As for the implementation? I've been using sbcl in slime/swank for awhile now, and it's pretty nice and fast. Slime is really nice.

Alex
+4  A: 

If you want to write practical code, and/or you want a good degree of portability from one implementation to another, use Common Lisp. There are eleven implementations currently under active maintenance. See my survey of implementations.

The different implementations have different strengths. If you want a free, open-source one, Clozure Common Lisp (CCL) (not to be confused with "Clojure"!) and Steel Bank Common Lisp (SBCL) are good general-purpose implementations. There are also commercial implementations, the best known being Allegro Common Lisp and LispWorks. For Windows-friendliness, Corman Common Lisp has useful facilities. For embedding, Embedded Common Lisp (ECL) is great (you don't have to use it in an embedded way). If you want a Common Lisp that compiles to the Java Virtual Machine, there's Armed Bear Common Lisp (ABCL). See the paper for others; which one you want depends on your individual circumstances.

Dan Weinreb
Wow! Your survey is terrific! Thank you.
clay
A: 

I don't care much for the difficulty of the syntax, just the power, flexibility, and other aspects of the language itself.

The syntax is equally difficult or not in any lisp. Clojure's syntax is a bit easier for non-lispers because different brackets are used. This makes more of a difference than one would expect.

Both Clojure and CL have excellent introductory books. I haven't read scheme books in any depth, but they seem to have a more academic flavor in comparison.

I would recommend Clojure or Common Lisp to a neophyte, based on personal experience.

Clojure is more functional and eminently practical. If using CL I recommend an IDE (Allegro & others have free versions), or using a text-editor and repl. In other words, don't use slime. For Clojure I can't think of any IDEs, but perhaps Textmate or Eclipse will have something?

Scheme has some very good IDEs too such as DrScheme. But I found it easier to stay engaged when doing somewhat of a real project, and both Clojure and CL seemed to make that easier.

nunb