Which Lisp should I learn?

18,767

Solution 1

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.

Solution 2

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.

Solution 3

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.

Solution 4

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.)

Solution 5

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.

Share:
18,767
Sakie
Author by

Sakie

Gregg Lind is a professional programmer living in Minneapolis, Minnesota, USA. I work for Mozilla on Test Pilot. Before that: Renesys, U of MN. Areas of interest: NoSQL, Literate programming, math phobia, gender gap in the hard sciences, information visualization, photography, snooty food, fixed-gear bicycles, Minneapolis, wind-power, dark beer, numbers, math and other kinky topics. likes: long walks on the beach, financially-secure men, flowers, data visualization, robot conspiracies, bicycles built for two. dislikes: eggplants, 2nd ring suburbs. Originally from Massachusetts, he stayed in the midwest after earning an undergrad degree in anthropology and biology from Grinnell. After a few years of shovelbumming, he found himself in Milwaukee, with weak prospects. After conning his way into a statistics job, and realizing that the people asking him for advice knew even less than he did about numbers, he decided to do the normal thing, and actually return to school, earning his M.S. from the U of Minnesota's School of Public Health's Division of Biostatistics in 2005. From there, it's been up, up, up, including a stint at the U of M Epidemiology Department where he worked on statistical genetics and statistical simulation projects.

Updated on June 14, 2022

Comments

  • Sakie
    Sakie almost 2 years

    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, good environments, and Unicode support.

    Things I dislike

    Flamewars. Features that are useful at the beginning, but interfere with long-term learning.


    Updates

    1. I've 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, 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.

  • nullException
    nullException about 15 years
    but it's hopelessly hindered by that JVM. how can you call LISP a non-tail-recursive language?
  • Greg Hewgill
    Greg Hewgill about 15 years
    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: ghewgill.livejournal.com/tag/psil for more info.
  • Jon Ericson
    Jon Ericson about 15 years
    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.
  • Greg Hewgill
    Greg Hewgill about 15 years
    How is Let Over Lambda? I've been considering purchasing that for the rest of the chapters that aren't online.
  • ayrnieu
    ayrnieu about 15 years
    I'll let you know. All I've done so far is skim through the Forth chapter.
  • ayrnieu
    ayrnieu about 15 years
    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.
  • Matthew Olenik
    Matthew Olenik about 15 years
    Clojure certainly has the advantage of creating immediately useful applications, since you have access to the Java BCL as well as any Java library.
  • Rayne
    Rayne about 15 years
    The JVM is central to Clojure's power, it's not hindered by anything.
  • Sakie
    Sakie about 15 years
    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!
  • Friedrich
    Friedrich about 15 years
    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
    Friedrich about 15 years
    Seems one has to hack around limits of the IDE I can not see a good reason not to prefer LispWorks or AllegroServe
  • ayrnieu
    ayrnieu about 15 years
    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.
  • Rayne
    Rayne about 15 years
    @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
    Rayne about 15 years
    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.
  • Sakie
    Sakie about 15 years
    @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.
  • Rayne
    Rayne about 15 years
    @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
    Rayne about 15 years
    @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. :|
  • Sakie
    Sakie about 15 years
    Rayne, I'm used to Python, and R. Usability and teachablity matter.
  • Sakie
    Sakie about 15 years
    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.
  • Rayne
    Rayne about 15 years
    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
    Rayne about 15 years
    If you're still interested in a LISP try 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.
  • Greg Hewgill
    Greg Hewgill about 15 years
    Thanks for that, I've ordered a copy!
  • Johan Kotlinski
    Johan Kotlinski almost 15 years
    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?
  • Ben Richardson
    Ben Richardson almost 15 years
    Clojure is lexically scoped, with thread-local dynamic scope of (usually toplevel) vars via binding.
  • Jay
    Jay almost 15 years
    @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.
  • Vlagged
    Vlagged almost 15 years
    > Pick anything but Closure I 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
  • mcandre
    mcandre about 13 years
    Thank goodness for #+ and #-. Without them, accessing CLI arguments, and any other POSIX behavior is next to impossible. rosettacode.org/wiki/ScriptedMain#Common_Lisp
  • Nicolas Bousquet
    Nicolas Bousquet over 12 years
    Just another comment on clojure. Clojure is a "pratical" and opinionated Lisp. Pratical because using the JVM give the reach to the biggest echosystem that exist today. Library support is astounding. And theses are very mature, broad and of production quality. Few echosystem can compare. Opinionated because clojure embrace immutability and avoid OOP at all costs. This is interresting and good. But you can find it anoying at time. This may not be your cup of tea. Clojure may not the best lisp from the learning perspective. But it is surely one of the best to make something professional with it.
  • Adam Arold
    Adam Arold over 12 years
    Please support that statement. Why shouldn't we use Clojure?
  • Kevin Peterson
    Kevin Peterson over 12 years
    @edem did you read beyond the first four words? First, I never said you shouldn't use Clojure. If you want to use Clojure, go for it. If your goal is to learn Lisp, on the other hand, you would do well to start with something closer to the main line of Lisp. For example, in Clojure tail recursion needs to be explicit in the code. Much of the library is implemented in Java. You'll also run into "is weird feature X part of Lisp or specific to Clojure".
  • Adam Arold
    Adam Arold over 12 years
    I started Clojure after finishing Practical Common Lisp tutorial. :) Thanks for the info.
  • X10D
    X10D over 4 years
    what's the absurd cruft of the 80s?