33

When I started learning CL from Practical Common Lisp, as is preached in the book, I started off with Allegro CL compiler. I stopped using it, since its commerical, yet free bit didn't impress me. It needed a connection to its remote server for some licensing stuffs.

I switched to 'clisp' and am using it. Now, I have been hearing about SBCL and planning to start using it as well.

So, the question is: How do the various ANSI CL implementations differ? Any practical experience of using one over the other ?

Thank you.

Ken
  • 486
  • 3
  • 11

9 Answers9

35

See Common Lisp Implementations: A Survey by Daniel Weinreb.

skovorodkin
  • 9,394
  • 1
  • 39
  • 30
huaiyuan
  • 26,129
  • 5
  • 57
  • 63
18

If you are on a machine that can run SBCL, you should use it. It's the fastest free Lisp compiler (it can generate code that is as fast as Haskell, OCaml, Java, C, and C++, which are all very very fast, especially compared to Python and Ruby). It also is a fairly complete implementation, and supports most of Swank's features (for SLIME), which is nice when you are developing.

As some of the other comments mention, you won't really notice any differences when you are first starting out. All the free CL implementations are "fast enough" and support all the features you'll need. But if you start writing production software, you will appreciate SBCL's features. OTOH, there's really no reason not to switch now.

jrockway
  • 42,082
  • 9
  • 61
  • 86
  • Thank You, I just made the switch. –  Feb 23 '09 at 05:02
  • 1
    SBCL's REPL is hard to use than clisp. – z_axis Oct 08 '11 at 02:49
  • @jrockway - does this advice still hold now in 2012? – Charlie Flowers Sep 21 '12 at 01:30
  • I haven't written a lot of CL lately, but SBCL is still good enough for me. – jrockway Sep 27 '12 at 00:13
  • 1
    CLISP will generally configure with readline support whereas SBCL does not. SBCL's REPL is much improved (from the command-line) if it is run with [rlwrap](http://www.cliki.net/rlwrap), which uses readline to perform similar functionality. When running with SLIME, I haven't noticed any difference in ease of use. If that's not what @z_axis meant, then perhaps he can provide more detail. Beyond that, [repl-utilities](https://github.com/m-n/repl-utilities) can make any REPL better. Now that I read the comments again, I see Charlie talking to jrockway...whatever, my comment still stands. – Nick May 03 '13 at 11:49
  • @CharlieFlowers I just tried it with SBCL 1.2.4.27-25de136 and it doesn't have history or the ability to use arrow keys etc. CLISP has a much better REPL out of the box. – Harry Oct 01 '14 at 23:30
16

I have been looking at Win32 solutions to the same question. As far free Lisp implementations on Windows, I would strongly recommend Clozure CL (CCL). There are several reasons for this. The first is that Clozure supports 32- and 64-bit binaries. It's very fast, and somewhat compact. But most importantly, it's consistent and correct. I find it to be an extremely mature Lisp, after working with Lispworks (which I miss) for several years. CCL does a very nice job with native OS threads, sockets, and some other elements that are not part of the CL spec. Its implementation of CLOS seems to be extremely thorough. And it's GC and memory management are excellent. I compared CCL to SBCL on Win32, and while SBCL was a bit faster on several benchmarks, it cons'd up a lot more, and its image kept growing and growing, even after several forced GCs. Meanwhile, CCL was consistent, small, quick, and lovely to use. And if you want a platform that's consistent across Windows, Mac, and Linux, and has both 32- and 64-bit support, then look no further.

I did try CormanLisp on Win32, and there were many things about it I liked. But it does not run properly on 64-bit Windows platforms, and is limited to Win32. It's also not free, and somehow I had it crash on me when I'd throw some garbage code at it. I also was easily able to make SBCL crash. Not so with CCL. Rock-solid. Really, those guys did an amazing job, and ultimately will help keep Lisp alive.

As for SLIME, I didn't try to get SLIME working with SBCL, but I did get it working nicely with CCL. No matter what your fancy is, I advise that people write code to be easily portable. Aim for Windows, Mac, and Linux, and aim for 64-bit. If you consider these, then CCL is your best choice overall.

A last attempt at an answer to this is to consider what is wrong with the others. Here's what I've come to find:

  • CLISP is nice, but is far slower, relative to SBCL or CCL. I see little upside
  • SBCL seems poor on Win32. Image size can get big.
  • CormanLisp is good on Win32, but not portable, and does not support Windows x64. It also seems that Roger Corman is not actively developing CormanLisp, which is a shame, but it's the reality.
  • Clojure (with a "j") is not Common Lisp. As nice as it may be, I think that if you already know CL, then it's not worth the overhead of learning Clojure's many differences. I'm sure some may pick them up fast, but I surely did not. (If Java-compatible code is what you're after, then look at ABCL).

dave

Dave Bakhash
  • 161
  • 1
  • 2
  • 4
    Can't agree more for CCL on Windows (x86 OR x86_64). Another nice thing about it is that it runs really well on linux, mac, BSD, and solaris too, so you can literally program once, run just about everywhere. I tend to develop in windows and push my code out to linux servers. Never have a problem doing this with CCL. – andrew Dec 07 '12 at 00:51
14

There are portions of ANSI CL that leave certain details up to the implementations to determine; you will find that for those parts of the standard, each implementation will have its own quirks.

Also, look for things that are important to the runtime but not defined in the language: things like threading and multiprocessing and garbage collection will vary substantially in performance and reliability.

I have found SBCL to be the easiest implementation to work with in Linux; it has good support for threading in Linux. I can't say much about the garbage collector, because it hasn't mattered to me much yet.

On Windows, your best bet will probably be Allegro or LispWorks, although I've had some success with clisp on Windows. The Windows port of SBCL is progressing, but I haven't used it much, so I can't really comment.

Generally speaking, an understanding of these kinds of things that are difficult to acquire through research or analysis; it comes through experience. Just pick a decent implementation that you're comfortable with, and get to work. You'll figure out the tricky stuff as you go.

Ben Collins
  • 20,538
  • 18
  • 127
  • 187
3

I don't know enough to give you a detailed answer, but I noticed that SBCL was considerably faster then Clisp when I was working with CL for my AI class. Unless you have a compelling reason not to, I'd suggest going with SBCL.

I've heard that Clisp is easier to install and is more portable than SBCL (which has lots of processor-specific optimizations), but if you're using Linux they're both easy enough to fetch from the package manager.

Kyle Cronin
  • 77,653
  • 43
  • 148
  • 164
  • I don't really know that much, but I felt bad you didn't get an answer. Hopefully what little I've provided helps! – Kyle Cronin Feb 22 '09 at 04:32
  • SBCL compile sto native code, clisp compiles to byte-code that is then interpreted by the clisp virtual machine. That is the source of both the speed and portability issues you've mentioned. – Vatine Feb 24 '09 at 11:12
3

I found the error messages in clisp to be more friendly and help me find the problem faster.

Arthur Ulfeldt
  • 90,827
  • 27
  • 201
  • 284
2

It seems that SBCL's REPL is not friendly compared with clisp ? E.G. I can use TAB key to auto-complete input in clisp.

so clisp is a better for lisp newbie.

z_axis
  • 8,272
  • 7
  • 41
  • 61
1

I've had pretty good luck with installing clisp using cygwin if you're under windows.

Jason Baker
  • 192,085
  • 135
  • 376
  • 510
1

Depends on your OS of choice

  • Windows - use ecl or abcl
  • Linux - use sbcl or ecl or abcl or cmucl
  • Mac - ccl or ecl or sbcl
  • Other - abcl or ecl or sbcl

EDIT:

Sbcl on windows lacks threading and is, in general not that stable, and none of core maintainers use windows.

ecl is much better choice for cross platform lisps, its feature set is equaly stable on all major platforms.

EDIT 2011-10: Sbcl windows now has threading support. It is not yet fully merged in mainiline, but there is a fork which is pretty stable which have threading and other Windows specific goodies.

Marko
  • 30,263
  • 18
  • 74
  • 108
  • I keep hearing that sbcl isn't good on Windows, but I rarely hear why. What makes you not say sbcl on Windows? Is it buggy? – Steve Rowe Feb 25 '09 at 07:10
  • 1
    You forgot to mention clozurecl. It is an evolution of openmcl. It is fast (both in compilation speed and runtime speed), produces native code (but somewhat slower than sbcl, as far as I know). It is available on both windows and linux (also on other OSes) in both x86 and x86-64. SBCL is unstable on windows. Its threading support is not yet fully done. – dmitry_vk Apr 21 '09 at 06:06
  • I mentioned it as ccl. It is fine impelementationm, but doesn't work without SSE2, so I can't run it. – Marko Apr 21 '09 at 10:39
  • @MarkoKocić are you sure about your processor lacking SSE2? double check, all processors since Pentium III have it. P.S. or was it a trolling? :)) – Luka Ramishvili Oct 12 '11 at 12:41
  • @LukaRamishvili AMD Athlon XP 2400 doesn't have SSE2, and CCL dosen't run on it. – Marko Oct 13 '11 at 09:08
  • 1
    It's sad. However, requiring SSE2 makes CCL developers able to efficiently process strings, as all CCL strings are 32-bit. – Luka Ramishvili Nov 15 '11 at 11:06