views:

2560

answers:

18

To piggyback on http://stackoverflow.com/questions/59428/learning-lisp-scheme-interpreter,

O gods of StackOverflow:

Which Lisp (dialect) should I learn, and why?

The fragmentation between CL and Scheme slows uptake (at least for me!).

So give me the True Answer, please.

I have tried to read feature comparisons, and they seem to get bogged down in esoterica (that I don't fully understand) like whether the dialect is fully tail-recursive, and the like. I'm hoping you all (collectively) can make the opaque differences clear.

Things I like: good library support (me=spoiled by python), good environments, unicode support.

Things I dislike: flamewars. Features that are useful at the beginning, but interfere with long-term learning.

Thanks! (please keep it flame free).

updates:

  1. Ive been mostly using MzScheme, which I'm enjoying just fine, once I got readline support going. I don't run a gui on unix, so it seemed to be a fine environment option for me.
  2. I'm also very happy that Clojure has an easy to install .deb package on debian unstable, so it's much easier to play with. This is a big win. Despite the hostility of some rather easy-to-anger below, low barrier to entry is a win. I like being spoonfed.
  3. After reading a lot more of SICP, I do understand the issues around tail recursion much better.
+5  A: 

Just pick one, and learn it. By the time you figure out the differences, you'll be in a position to choose again, if you chose badly the first time.

Gregg Lind
do you have split personality or are you just trying to earn self-learner badge?
John T
Oh, well, this is my answer to myself, and I thought it would get the ball rolling in a non-flame sort of way. @john T, funny. I won't accept it. I'm hoping for a true answer from the gods of SO
Gregg Lind
I think this is a fine answer. But you don't have to go so far as to learn an entire language. I read enough about Scheme to know I won't be happy with it. Common Lisp is more my style, but it hasn't pulled me away from Perl. If you want to learn languages, you won't pick just one.
Jon Ericson
Thou durst attempteth to refuseth gifth that the Holy Gods of SO hath bestowed upon thee?
Lucas Jones
+25  A: 

Clojure is an actively developed, modern dialect of Lisp. It's based on the JVM, so all the Java libraries are immediately available, and therefore also has Unicode support.

This is one alternative, not the One True Answer.

Greg Hewgill
but it's hopelessly hindered by that JVM. how can you call LISP a non-tail-recursive language?
Javier
Common Lisp is not tail recursive either. I agree that tail recursion is good; I'm working on a Lisp dialect similar in spirit to Clojure but hosted in Python: http://ghewgill.livejournal.com/tag/psil for more info.
Greg Hewgill
Javier, Clojure has a `recur` (that can only appear in a tail position) that gives you a tail-call that you can naturally express recursive functions with. The JVM hindrance that I've seen anyone complain about: [no unsigned types](http://gnuvince.wordpress.com/2009/02/15/clojure-and-starcraft/).
ayrnieu
Clojure certainly has the advantage of creating immediately useful applications, since you have access to the Java BCL as well as any Java library.
Matt Olenik
The JVM is central to Clojure's power, it's not hindered by anything.
Rayne
When I went to the site I was immediately turned off by what it talked about -- differences from other lisps, how to get it running under the jvm. Where's my hello world!
Gregg Lind
Seems one has to hack around limits of the IDE I can not see a good reason not to prefer LispWorks or AllegroServe
Friedrich
@Gregg I don't understand what you mean, what is the problem with that? It's not that hard to set up. Especially if you use Eclipse or Netbeans as an IDE for it. It's a perfectly LISPy LISP if that's what you are worried about, but there are differences and that's a good thing.There is a wiki with..
Rayne
Code examples as well, along with other stuff.@Friedrich There is Cusp for Common LISP, there is Enclojure (netbeans) and Clojure-dev (Eclipse) for Clojure. We are not IDEless.
Rayne
@Rayne, my problem with it, is that as a new learner, those are the things I am absolutely least interested in. I view having to work in the jvm, and deal with any java stuff as a minus not plus. When I look at a new language's site, I want to see *how to code in it.*
Gregg Lind
@Gregg You don't have to worry about Java stuff. Dig a little deeper, there is a Wiki that's dedicated to "Hello world!" and getting you into the language. You're being weird right now o_o.
Rayne
@Gregg The Java or C# sites don't have hello world plastered on their front pages either. C and C++ don't even have web pages. :|
Rayne
Rayne, I'm used to Python, and R. Usability and teachablity matter.
Gregg Lind
Rayne, it just really turned me off, by focusing on the stuff that I'm least interested in, and showing what I consider a disregard for accessibility and evangelism.
Gregg Lind
I don't think you are looking to learn a LISP. If you want to try functional try Ruby. If you need to be spoonfed everything then you wont find that in Clojure. Not right now.
Rayne
If you're still interested in a LISP try http://www.ociweb.com/mark/clojure/article.html that's the closest to spoon fed you'll get out of a LISP. Just because you use Python doesn't mean you should expect every language to conform to it's profile.
Rayne
I tried Clojure now, "Hello, World" takes over 1 second to start and run for me. Is it supposed to be like that, or am I doing something wrong?
kotlinski
+4  A: 

for me, the foundational theory of Scheme is far more convincing. PLTScheme is, by far, the most actively developed LISP i've found. unfortunately, it has a proliferation of typing that obscures the beauty of LISP.

i'd love to see something like arc succeed, but it seems unlikely.

Javier
Clojure is constantly being developed. Maybe even more actively than PLTScheme, but I can't promise that.
Rayne
i'm still unconvinced to call clojure a LISP
Javier
+6  A: 

Lisp's biggest problem is that there's no overriding standard everyone sticks to. You don't just have to pick between Common Lisp and Scheme; you have to pick between several incompatible implementations of Common Lisp and several incompatible implementations of Scheme, as well as other little things like Arc and Clojure.

I would recommend starting with MzScheme. It's popular, it's actively developed, it has many libraries offering the features of a modern programming environment, and Scheme is somewhat simpler (not to say better, just simpler) than Common Lisp.

Chuck
Common Lisp is a Standard. So are the diverse RSx Scheme standards. What I dislike mostly about DrScheme is it's standard Object model.
Friedrich
+3  A: 

Take a look at IronScheme.

Nemanja Trifunovic
Thanks for the plug :)
leppie
+13  A: 

Contra Chuck, an advantage of Common Lisp is that it has a standard that implementations stick to and strive for, such that you can develop largely with SBCL (which has excellent type checking and inference) and then, say, deploy as an executable linked with C libraries (with ECL or others) or as a .jar making use of Java libraries (with ABCL), or with a Mac or a Windows-native GUI (Clozure, both). Common Lisp is amazingly portable across architectures and over implementations and over time, and Common Lispers make efforts to keep things this way, with the support of the language. As an illustration, one silly divergence of unstandardized behavior is the question "is this a special variable?" So I answered it across the implementations I use:

#-abcl
(defun special-variable-p (symbol)
  #+ecl(si:specialp symbol)
  #+ccl(proclaimed-special-p symbol)
  #+sbcl(equal '(:special t)
               (multiple-value-list-int:info :variable :kind symbol)))

which reduces, at read time, to nothing on ABCL (it has this already), to (defun special-variable-p (symbol) (si:specialp symbol)) on ECL, and so on. So I can put this in my .rc files and use the common function at the REPL. But this isn't very important: this isn't threading or variously-backed networking or a Communicating Sequential Processes library. This last example just has one #+sbcl/#-sbcl even as it runs on five implementations. Because it relies on code that's been carefully ported.

But what permits this (and other) advantages also poses its own challenge to the learner: Common Lisp is a very big language. It isn't something you can slurp up in a week or two, like I did Clojure (but my Clojure is already decaying with the breaking changes set to roll out - that language, although heavy with its own merits, reminded me by contrast of a lot of what I like about Common Lisp.) So you should read a lot of this page, and keep the HyperSpec a keypress away (for me, M-x hyperspec RET do-symbols RET is sufficient nearness to the Bible.), and think about buying a few books. I have Practical Common Lisp, just got Let Over Lambda, and will buy PAIP real soon now.

But even if Common Lisp is the True Answer, you won't completely waste your time by 'just picking' some deceptively flashy alternative (-- 'deceptive' because commonplace CL doesn't show you all that its macros can do, and it has more kinds of macros than anybody. The usual comparison is between bad CL and syntax-optimized alternative X). You'll still learn the basics, you can still use much of what you can read in SICP, On Lisp, The Little Schemer, etc. A lisp, even the wrong lisp, is still better than a non-lisp. (But you'll spend some of your time implementing parts of the right lisp, poorly, in the wrong lisp. Meta-Greenspun.)

ayrnieu
How is Let Over Lambda? I've been considering purchasing that for the rest of the chapters that aren't online.
Greg Hewgill
I'll let you know. All I've done so far is skim through the Forth chapter.
ayrnieu
OK. I'd have to think a while, and try to recall earlier stages of my development, and reread other books to be fair to them. But absent that: LOL is the best. The book paints a target on the 'stylistic aphorisms' against macros, italicized on the first section of the first chapter.
ayrnieu
Thanks for that, I've ordered a copy!
Greg Hewgill
+1  A: 

Learn elisp so you can extend Emacs.

mletterle
Can I used it to dis-extend emacs back to manageable size :)
Gregg Lind
I hate when people bitch about Emacs size. When you have such a great editor, why does the size matter? It's an OS in a window. Get over it.
Rayne
Among the best 3 IDEs, emacs is the smallest already. (The other two is left for the reader to fill in ;)
Sake
Emacs is smaller than vi and vim?
kunjaan
+12  A: 

If you want avoid flamewars and you enjoy libraries go with Clojure. It's small, it's fast, and the community is helpful and non-dogmatic. It's Lisp minus the absurd cruft of the 1980s . It has a BDFL and if you have a good idea there's a damn good chance it will get implemented into the language.

I have toyed around with Common Lisp, it's a beautiful thing. I've completed the first 3 chapters and the Metacircular Evaluator in SICP in DrScheme, and that is beautiful thing as well. Of course, you will benefit greatly from learning these.

But, over time I have come to hold small languages dear to my heart. I won't lie, I love Javascript and I love C (and goddammit if every language doesn't have a C core at it's heart) because they are small.

Clojure is small. It is elegant. It is a language for our times.

dnolen
+1  A: 

I think you either want Common Lisp or PLT Scheme.

The former comes with a lot of freedom and power (that might overwhelm you at first) and the latter comes with a bunch of libraries, matching tutorials and a well-integrated IDE.

skypher
+4  A: 

Conjecture: when learning your first lisp, don't learn one you'll end up using for end development.

Lemma: learn Arc. It's all of the "hard to grok" things in lisp - closures, macros, continuations, with none of Clojure's Java interop complexity, CL's namespace confusion, or Scheme's name fragmentation. If you're dedicated, you can learn all of these things in a weekend. If you're sharp and dedicated, in a night.

And it'll make learning all the other lisps a lot easier.

Andrey Fedorov
+8  A: 

Clojure is a great dialect of LISP that promotes functional programming. It runs on the JVM so you have access to any Java libraries you might be used to using. The site has great documentation and screencasts to help you learn. Another advantage is that it's really easy to install, unlike a lot of other dialects.

If you're just looking to grok the concepts Emacs (EmacsLISP specifically) is another alternative. It comes with incredible documentation, tutorials, and lots of code samples. Screencasts are fairly easy to find as well. One of the great benefits of Emacs is that the editor is written in LISP so the editor naturally has very good support for running, editing and debugging LISP. In addition, you can extend the editor to make your every day text editing needs easier while you learn LISP.

Bryan Kyle
A: 

I am a fan of Scheme, but it has been more than 10 years since I did anything with Scheme.

like others have said - just pick one and go.

Tim
A: 

There are very few real choices there, either SBCL, Clojure or PLTScheme.

Dev er dev
+3  A: 

Go with Clojure. It's an amazing language with full access to any Java library. It has been in development for just over 2 years and already has 3 IDE plugins in development and a book being published in April about it. It's very fast, very elegant and beautiful. You can't go wrong with Clojure.

Rayne
+1  A: 

You know... When I got interested in Lisp I also thought I'd have to choose. Then, after reading and asking a lot, I ended up choosing Common Lisp. Not because it's "better" than Scheme in an absolute way, but because it had features I knew I'd probably use in the next 2-3 years in my projects:

  • A very efficient compiler for numerical computation (SBCL),
  • The condition system, and...
  • I have to admit that SLIME also played an important role in this decision. :-)

So if I were you, I'd start learning a tiny bit of each language, and find out what are the relative strengths and weaknesses of each (I mean, those related to what you'll need/want to do most often) so you I could pick one. You may just find out that you'll learn the other later also (happened to me -- I had to learn more Scheme after one year studying Common Lisp)

As to Arc, Clojure and Lush, and don't know those. I suppose the same argument could apply to them too... The reasons I didn't want to invest too much on them were: Arc does not seem to be interesting for numerical computing, and P. Graham seems obssessed by code size (to the point of making his code unreadable); Clojure seems nice, but I don't like the JVM. And Lush... Well, besides using dynamic scope, the compiled and interpreted versions of the language are very different -- and you can't compile recursive functions. So, it was either Scheme or Common Lisp to me.

Jay
Clojure is lexically scoped, with thread-local dynamic scope of (usually toplevel) vars via `binding`.
Brian Carper
What were those "features I knew I'd probably use in the next 2-3 years in my projects"
Gregg Lind
@Gregg Lind: the "features" are: 1) a very efficient compiler for numerical computation, and 2) the condition system.I have to admit that SLIME also played an important role in this decision. :-)
Jay
@Brian Carper: thank you! I didn't know Clojure was lexically scoped. I vaguely remember having read on clojure.org that it had dynamic scope, but I probably mixed up facts.
Jay
@Jay, thanks for answering, maybe add it to your main answer! That's exactly the sort of thing that's interesting to know.
Gregg Lind
+3  A: 

I do not know Lisp but heres why I think PLT Scheme is a good choice:

  1. Really Good Documentations
    http://download.plt-scheme.org/doc/html/

  2. DrScheme
    DrScheme is an amazing programming environment that comes with a compiler, stepper, syntax checkers, REPL, myriad of languages support and is extensible. This makes the entire experience fun. See some screenshots

  3. Good Support from the community.
    The community is very enthusiastic about their language and very supportive too. If you have any questions, mailing lists, groups and forums are available. Even the authors are very very accessible.

  4. Continuing Research
    PLT is very active and continue to make their tool better and better. You can expect a lot of innovations from the labs. eg. Im pretty excited about using this: http://blog.plt-scheme.org/2009/05/typed-scheme-20.html

  5. Free Books and interesting tutorials to get you started.
    http://www.htdp.org/
    http://world.cs.brown.edu/

  6. Good modules and extensive libraries.
    http://www.cs.utah.edu/plt/develop/
    http://planet.plt-scheme.org/ also see docs

If you are learning Scheme, give DrScheme a try.

kunjaan
+1  A: 

Pick anything but Clojure, go with it, and you will be in a better position to evaluate later.

You phrased this question as which Lisp is the best medium for learning Lisp, and to me that has to include a Lisp that is built up from low level primitives, whereas large parts of Clojure are written in Java.

If you had phrased this question as which is the best Lisp to start a new project in, then Clojure may be the best choice.

Kevin Peterson
> Pick anything but ClosureI really wished I see a counter-argument to 'access to all JVM libraries', because I really really can't imagine what java am I going to use if I pick up on LISP/Scheme
Vlagged
A: 

Since I can't comment, I'll write my comment as an answer:

I did what Andrey Fedorov suggested above- I learned Arc to get familiar with thinking in Lisp. I liked it because it was easy to install and understand, and the tutorial was helpful (http://ycombinator.com/arc/tut.txt). Now, I find myself using Clojure for a lot of things that Arc doesn't have libraries for yet.

yayitswei