Common Lisp/First steps/Installation

In order to start programming in Common Lisp, you need to obtain a Common Lisp implementation. There are many of them available for most operating systems. There are both free and commercial implementations.

EditorsEdit

EmacsEdit

The easiest way to get started with Common Lisp is to use Emacs. Emacs, or you'll hear people sometimes refer to it as "vanilla Emacs", is the preferred way to write lisp by a majority of lispers. If you're also new Emacs then the below might be helpful, but they might also feel overwhelming for new users. If you're going to use Emacs, you should probably also install slime. Slime will help you edit common lisp; it comes included with the environments below.

PortacleEdit

Portacle is a portable and multi-platform Common Lisp environment, which is usually recommended to beginners nowadays. It offers SBCL, Emacs (with nice customization), Quicklisp and Git packaged together. There is no installation needed, so it really is a straightforward way to go.

Doom EmacsEdit

Doom Emacs is a popular pre-configured version of Emacs that is suitable for beginners and advanced users alike.

spacemacsEdit

spacemacs is another popular pre-configured version of Emacs that comes fully equipped for use with Common Lisp.

VimEdit

vim, or neovim, is a very common text editor for programmers. If you're already familiar with vim, you can still use it to edit Common Lisp as well.

slimvEdit

slimv is probably the most popular vim plugin for editing Common Lisp.

vlimeEdit

vlime is a newer alternative to slimv that is mostly written in viml (vim's extension language).

Free implementationsEdit

Note: Even if you don't want to install Portacle, it's still highly recommended to use the Emacs/SLIME combination to interface with these implementations. The reason is that the text console which they provide is quite awkward to work with, so most users prefer a nicer environment like the one SLIME provides.

GNU CLISPEdit

GNU CLISP is a popular free implementation which can run on Windows and most Unix-like systems. If you're using Windows, you don't have much choice but to use CLISP. CLISP provides all ANSI Common Lisp features and is quite easy to install.

FeaturesEdit

  • Full Unicode support
  • Localised interface and compiler messages
  • High portability: runs practically anywhere
  • Compiles to portable bytecode (most or all other Common Lisp implementations compile to native code)
  • Small memory footprint
  • Arbitrary precision floating point arithmetic

ShortcomingsEdit

  • Slow at number crunching

CMUCLEdit

CMU Common Lisp is a high performance Common Lisp implementation.

FeaturesEdit

  • Non-native threading (“green” threads; x86 only)
  • Produces fast code due to its optimizing compiler that produces native code
  • Fast compiler

ShortcomingsEdit

SBCLEdit

Steel Bank Common Lisp, a fork of CMU Common Lisp, is a portable implementation featuring native code compilation. It's easily the most popular Common Lisp compiler on platforms which neither CMUCL nor CCL will run on and an excellent choice even on those mainly because of its better debugging support (for instance, its compiler yields more warnings and is said to be stricter regarding ANSI compliance).

FeaturesEdit

  • Unicode support
  • Quite portable: runs on Unix-like systems including Mac OS X and Microsoft Windows.
  • Native threading support on Intel-based platforms
  • Good speed because of the optimizing compiler that produces native code

ShortcomingsEdit

  • Slow compilation speed (SBCL performs *many* optimizations, which can be slow)

Clozure CLEdit

Clozure CL is a Common Lisp implementation the PowerPC and AMD64. There is a pre-release x86 version. It is easily the most popular choice on Mac OS X, but it runs equally well on GNU/Linux and FreeBSD/amd64 systems; there is also a beta for Windows. On Mac OS X, CCL features a Cocoa interface.

FeaturesEdit

  • Full Unicode support
  • A fast compiler that produces equally fast code
  • A Cocoa interface for Mac OS X GUI development
  • Native threading

Embeddable CL (ECL)Edit

ECL is a Common Lisp implementation focusing on portability and embeddability. These goals are obtained by translating CL into C and passing that to a C compiler (typically gcc). It runs on Linux, FreeBSD, NetBSD, OpenBSD, Solaris and Windows, running on top of the Intel, Sparc, Alpha and PowerPC processors.

FeaturesEdit

  • Unicode support
  • Translates CL into C, which produces relatively fast native code
  • Interpreter which circumvents the slow build times
  • Load on demand. ECL defers loading modules until needed
  • Ability to output portable C source files that can be compiled on other architectures
  • Call C from Lisp and call Lisp from C (i.e. ECL can be used as an extension language for any program that can call a C function)
  • Native threading

ShortcomingsEdit

  • Relatively slow compilation method (gcc is slow, maybe if you use a faster C compiler)
  • Relatively fragile error handling (i.e. you can seg-fault ECL fairly easily)

Armed Bear Common LispEdit

ABCL is a Common Lisp implementation that runs on top of the Java Virtual Machine. It provides a runtime system, a compiler that compiles Lisp source to JVM bytecode, and an interactive REPL for program development.

FeaturesEdit

  • Produces portable Java bytecode
  • Java libraries are transparently available

ShortcomingsEdit

  • Quite slower than other implementations

Commercial implementationsEdit

There are free trial versions of Allegro, LispWorks, and Corman Lisp, which can be handy for learning the language. All of them work on Windows.

External linksEdit