Monday, February 9, 2009

Which Lisp to Learn?

So you decided to learn lisp and you are confused with all those choices.
There's something called Common Lisp (is that for common people only?), than Scheme (Would I become a Schemer?), than Arc, Clojure, NewLisp, Qi and who knows what. So before your head is going to blow your are going to comp.lang.lisp newsgroup and asking for a recommendation. Then the hell opens and your honest question erupted into an ugly flamewar with otherwise mostly good people accusing each other and calling other people ugly names. So while your asking yourself what have you done in your past life to deserve such faith let me explain you a few things. The name lisp is a general name for the lisp family of languages as per John McCarthy wish, the inventor of lisp, lisp should be used as label for the whole family of lisp languages instead of describing just one language. Something like c, c++, c# and java are family of c language & its descendants. That wouldn't be such a huge problem if the ruling patriarch of lisp family, common lisp had it's own newsgroup. Something like comp.lang.common-lisp , but (for unknown reasons) it doesn't. So all the common lisp users, the majority of lispers, dwell on comp.lang.lisp which is generic groups for all lisp family of languages. So your action was like going to generic group for c and c language descendants and asking what language should you learn. Hypothetically you would heard discussion like this :
c-user: Learn c it's the right real thing.
c++-user: No learn c++, c is too low level.
Java-user: No learn Java, it runs everywhere.
c#-user: No learn c#, it has best ide and tail call elimination.
d-user: No learn d, it has the latest and greatest staff.
And then everything will go to hell like:
c-user: c++ is ugly as sin.
c++-user: Java is dog slow.
java-user: c# is microsoftware
c#-user: Java is sunware
...duscussion continues with people calling each other ugly names

Now that you understand what happened let me give you my not so neutral
advice about most popular lisps so you could decide for yourself
which lisp to learn.
1.Common Lisp - It's an industrial strength, multi platform, specified
by ANSI standard lisp. It has the largest active community, many high quality
implementations, huge number of libraries, and enormous amount of material
to learn it even compared with mainstream languages.Also Kent Pittman excellent hyperspec is a first stop shop for any questions regarding Common Lisp.
2. Scheme is the language that started to be minimalistic but it abandoned that way with advent of latest standard. It is more aimed at functional style,and has full blown continuations, something that common lisp lacks. Though it has 2nd only to common lisp community, scheme community is balkanized across different implementations. Scheme has many high quality implementations but the problem is that there is many incompabilities between them since its still de facto standard R5Rs is very small. The latest standard R6RS smooths many incompabilities but it needs time to gain acceptance. Scheme also has huge amount of learning material.And the famous sicp is a must read for every serious lisper, not just schemers.
3. Qi - is a product of Mark Tarver, it introduces powerful static typing system, adapts pattern matching, embedded prolog etc.There is one excellent book by Mark Tarver, Functional Programming in Qi. Little learning material compared with common lisp and scheme. The community is small.Very few libraries, though you could use common lisp ones. Single implementation that runs on top of common lisp.
4. Clojure - Runs on top of JVM. Aimed at functional programming and introduces many novel ideas to support SMP and concurrency. One book, Programming Clojure, spartan reference manual. Little learning material compared with common lisp and scheme. Small community and libraries, though you could use Java libraries. And a single implementation.
5. NewLisp- simple lisp aimed at scripting. Three books and pretty good reference manual . Little learning material compared with common lisp and scheme. Small community and libraries.Single implementation.

If above descriptions of some of the lisps that I more of less tried didn't helped you to make your mind, than my recommendation is to go with common lisp, and then switch if you find other lisp more to your needs. Some lisps offer some new blood, but they all have much to learn to compete with a battle proven beast as common lisp. Though some lisps are better in some areas they are usually far worse in many other areas. In the end It's up to you. And yes I am a common lisper.

7 comments:

  1. I think it is pretty fair description, Slobodane.

    ReplyDelete
  2. Thanks for your comment. If you feel NewLisp has some other strength that could be described in few words advice and I will add it into my description.

    Though I disagree with some design solutions in NewLisp I have a respect for people who managed to implement their dialect and gather community around it. Anyway I have some ideas what next lisp should have but I doubt it could be called simple if it implements them. Just mail me if you're interested. slobodan.blazeski@gmail.com

    ReplyDelete
  3. A small addition to a good article - there is a book on Clojure called "Programming Clojure" by Stuart Halloway published by Pragmatic Programmers.

    The official publication date is April 2009, but it is already available in beta form from PragProg. The current beta (6) is prose complete and is very readable.

    There are some great books on Common Lisp that have been very helpful in learning Clojure for me: Gentle Introduction to Symbolic Computation by David Touretzky and Practical Common Lisp by Peter Seibel.

    Both books are available for free online from their authors.

    ReplyDelete
  4. Just to clarify, when you say newLISP has "little learning material", are you saying that there's a lack of quantity and/or quality, or are you expecting much more than what there currently is (eg 200+ pages, two tutorials, videos including on YouTube, etc...).

    ReplyDelete
  5. Probably Slobodan meant relatively little which is true - there is much more books, popular and scientific articles about Scheme and Common Lisp.

    However, Newlisp has fair collection of materials:


    * Reference manual (~450 pages)

    * Code patterns in Newlisp (~100 pages)

    * GUI library manual (~100 pages)

    * Standard libraries documentation (~ 75 pages)

    * Cormullion's Introduction to Newlisp (~180 pages)

    * Few smaller articles

    * Dmitry Chernyak's book Newlisp for Programmers on Russian language

    * Michael Michaels' ~35 videos, ~2.5 hours total

    * Few "third party" blogs and www sites partly or completely dedicated to Newlisp with lot of theoretical and practical examples.

    ReplyDelete
  6. newLisper
    I mean relatively little learning material compared with cl and scheme. I've edited the wording to avoid further confusion.

    Kazimir
    Thanks for the info I've added Introduction to Newlisp and Dmitry Chernyak book links.

    ReplyDelete

Note: Only a member of this blog may post a comment.