Getting Started
This article describes what you need to do to get up and running with Common Lisp.
For the fastest solution, see Portacle. It is a portable and multiplatform development environment, with no installation needed. However, Portacle does require using Emacs. For other alternatives, see here.
Linux & macOS
Linux and macOS differ only in how we install things, so we’ve grouped both in the same section.
Install SBCL
On both Linux and macOS, we’ll use SBCL as the Common Lisp implementation.
Ubuntu/Debian
To install SBCL on either, just run:
$ sudo apt-get install sbcl
Arch Linux
Since SBCL is available from the official repositories, you can install it with:
$ sudo pacman -S sbcl
macOS
To install SBCL on macOS, just do:
$ brew install sbcl
Install Quicklisp
Next, we set up Quicklisp, the package manager. This is similarly easy:
$ curl -o /tmp/ql.lisp http://beta.quicklisp.org/quicklisp.lisp
$ sbcl --no-sysinit --no-userinit --load /tmp/ql.lisp \
--eval '(quicklisp-quickstart:install :path "~/.quicklisp")' \
--eval '(ql:add-to-init-file)' \
--quit
This will install Quicklisp to the ~/.quicklisp/
directory.
Installing Emacs and SLIME
SLIME is a Common Lisp IDE built on Emacs. You can install it with Quicklisp using:
$ sbcl --eval '(ql:quickload :quicklisp-slime-helper)' --quit
Then, add this to your ~/.emacs.d/init.el
:
(load (expand-file-name "~/.quicklisp/slime-helper.el"))
(setq inferior-lisp-program "sbcl")
Running SLIME
Now that you’ve installed SLIME, you can run it by running Emacs and typing M-x
slime
. That is: the Alt
key along with the x
key, then type slime
in the
little buffer at the bottom. Press enter, and a REPL will start.
Windows
On Windows, you can use Portacle.