Running Lisp on Mason

Lisp runs fine on mason.gmu.edu (type lisp). But only use Lisp on Mason to verify your code, not for development. Instead, do development on your own machine -- it's much less painful. However, in Prof. Luke's classes, your Lisp homework and projects must compile and run properly on Mason for them to count. So be sure it's working on Mason.

If you're familiar with Emacs, you may wish to run lisp under emacs on mason. You probably will want to install slime as well. See below for more information.

Getting a Lisp system at Home

On the Command Line

The basic, if primitive, way to get Lisp running is to install a command-line Lisp system. This works especially well if you have a UNIX system (OS X or Linux). Command-line Lisps include:

SBCL is a recent revision of CMUCL with new modifications and additions. I recommend SBCL as the best command-line Lisp. However, SBCL is very verbose and warning-filled though, which can get quite annoying. On the Mac, if you prefer a quieter, more forgiving, and decently fast Lisp, try CCL or MCL.

CLISP is a good Common Lisp, and is highly portable to nearly every environment out there. However, the reason it is portable is that it compiles to a bytecode interpreter rather than to machine code, and so it's pretty slow.

MCL is a freeware command-line-only version of Macintosh Common Lisp, which runs under MacOS X nicely. It is much faster than CLISP on the Mac, but its debugging facilities are primitive.

CCL, or Clozure CL, was a fork of MCL way back when but now is a high-performance Lisp implementation in its own right, and runs on a lot of different platforms. If you're getting annoyed at SBCL's verbosity, try CCL.

CMUCL is a first-rate Common Lisp, but it is not available on all platforms. CMUCL is the system from which SBCL sprang.

If you're interested in playing around with it, ABCL is a Common Lisp implementation which runs on the Java VM. Note that it's not particularly fast (yet).

Lisp IDEs

Lisp is an interactive programming language and IDEs were invented originally for Lisp. Use an IDE designed for Lisp -- it will make your coding far more productive. There are several approaches to doing this:

Use a Lisp system with a built-in GUI. The some choices here are:

Clozure Common Lisp is the GUI version of CCL and is available on the Mac App Store. I love Clozure -- it goes way back to my early Mac days -- but have found it to be crashy.

You should augment your Emacs system by installing slime a set of Emacs extensions which dramatically enhance its ability to act as an IDE for Lisp.

One gotcha that befalls students is that Emacs is also written in Lisp -- just not Common Lisp. Emacs is written in its own variant of lisp called, not surprisingly, Emacs Lisp. But you're not using Emacs Lisp. Instead, you're using Emacs to run and control another Lisp system (SBCL, etc.) However, it's easy to mix up running code in Emacs Lisp with running code in the underlying Common Lisp system. So just be aware of this fact in case you start getting lost.

Emacs+SLIME+Lisp is so common an approach that there are several all-in-one installation bundles available:

You might try the LispBox page, which has installers for Franz Allegro, OpenMCL, SBCL, and CLISP, on Windows, Linux, and OS X. I've not tried it myself, but you might have luck there. And the guy knows what he's talking about. Apparently he's not going to be maintaining it much anymore however.

Another nice all-in-one bundle for OS X is ReadyLisp, which ties together Aquamacs Emacs, SLIME, and SBCL.

Use a command-line lisp plugged into the terminal version of Emacs+slime. This is rather more painful, though less painful than logging into mason! The procedure here is essentially identical to the GUI Emacs above.

Another new project which tries to do some of SLIME inside of vim: slimv.

Not Common Lisp

You should be aware that there are two other variants of Lisp out there which are NOT Common Lisp. Those variants are Scheme and Emacs Lisp. Do not use either one. Scheme is a really nice language, but it's not what we'll be using. BTW, if you want to try out Scheme, PLT Scheme is definitely the way to go. If you'd like to instead edit Scheme with Emacs, check out quack.

There are some new Lisp-related languages lately. Qi tries to move Lisp towards strong typing languages like Haskell or Ocaml. Clojure is a Lisp of sorts which is designed to directly target the Java Virtual Machine. And Arc is Paul Graham's exploratory revision of Lisp for rapid coding.

My Tutorials and Assorted Lisp Stuff

Lisp is a daunting language. To help you get up to speed quickly, I have put together a Lisp tutorial that coverx concepts of the language which are similar to languages you've already seen. This should enable you to do basic programming in Lisp. I give short shrift to features special to Lisp. Afterwards you should have enough basics to tackle the "special to Lisp" features (macros, CLOS, etc.) in a textbook at your own leisure.

My snarf object-oriented language. Much smaller and simpler than CLOS. An example of how you can bend Lisp to your will (in this case: I've modified Lisp to support an OO language with a fe macros and functions). This is often how Lisp is used in big projects -- programmers twist Lisp into the language they'd most like for their project, then write in that language!

Other People's Lisp Tutorials and Information

One of the best books out there is now available entirely online. It's a lisp tutorial called Practical Common Lisp, by Peter Seibel. It's got a lot of examples that you may find helpful.

Another good online Lisp tutorial called the Lisp Primer. It's very good.

If you've read all the way to the bottom of this page, you're clearly into Lisp. Here's where you get advanced Lisp packages of all sorts (everything from networking to regular expressions to 3D graphics): QuickLisp. Basically, it's apt-get for Lisp. But you have to know what you're looking for.