For the host for newcomers, or to print and leave on the table. The aim is a REPL that answers, and a first function, before the talk starts.
In the browser, with nothing installed
If time is short or the laptop is locked down, start in a browser:
- the shared REPL on the front page of https://common-lisp.net/, or
- JSCL, a Common Lisp that runs in the browser.
Both are enough for the first exercises in exercises.lisp.
On the laptop
1. Install a Lisp. SBCL is the usual first choice: fast, free, and on every system.
| System | How |
|---|---|
| Debian, Ubuntu |
sudo apt install sbcl |
| Fedora |
sudo dnf install sbcl |
| macOS (Homebrew) |
brew install sbcl |
| Windows | The installer from https://www.sbcl.org/platform-table.html, or SBCL inside WSL as for Ubuntu. |
| Anywhere with Docker |
docker run -it --rm clfoundation/sbcl |
Clozure CL, ECL and the others on the implementations page work as well.
2. Talk to it. In a terminal, type sbcl, and at the * prompt:
(+ 2 3)
(defun greet (name) (format nil "Hello, ~a!" name))
(greet "Lisp")
(exit) leaves it.
3. An editor. The REPL in a terminal is enough for tonight. To go further, pick one:
- Emacs with SLIME or SLY, the editor most Lispers use. The
quickest way in is Portacle (Emacs,
SBCL, SLIME and Quicklisp in one download), or Doom Emacs with its
common-lispmodule. - VS Code with Alive, for people who know VS Code.
- Vim or Neovim with Vlime or Conjure.
- Lem, an editor written in Common Lisp, with a REPL built in.
- LispWorks Personal Edition or Allegro CL Express, the commercial implementations' free editions, each with an IDE.
4. Libraries. Quicklisp fetches and
loads libraries. Download quicklisp.lisp from its site, then
sbcl --load quicklisp.lisp and follow the three lines it prints. After
that, (ql:quickload "alexandria") loads a library and everything it
needs. (ocicl and
vend are newer alternatives.)
Where to go next
- Getting started and documentation on common-lisp.net.
- The Common Lisp Cookbook, recipes for everyday tasks.
- Practical Common Lisp, the book most people learn from, free online.
#clschoolon Libera.Chat for beginners' questions, and#commonlispfor everything else.- The next meeting: https://common-lisp.net/meetings/.