In the mood for Lisp

Just like in the Hong-Kong movie "In the mood for love", where love is hinted at in every scene but consummated in none, I have dreamt of a Lisp Machine without ever having seen one, neither out far nor in deep.

costume-institute01.jpg

So when I put my hands on a 35$ credit-card sized computer, the curiously named Raspberry Pi, I felt the urge to pay tribute to the act of longing for elusive Lisp Machines, be it through pretense or travesty.

TL;DR: Cookbook-style recipe to lispify your Raspberry Pi.

The cunning scheme unfolds in three acts. Two of those have been documented better than I ever could, so references will suffice. I'll dwell a bit longer on the third step.

Act I
Build Emacs from source

Why? Because the packaged Emacs on Debian "Wheezy" is behind by a major version, and because building Emacs from source is straightforward.

https://coderwall.com/p/uztyfw

Note: Unlike the author, I did not have to symlink gcc.

Building Emacs on Raspbian is actually no different that what is called for on generic Debian, so instructions should be interchangeable.

Act II
Install Clozure Common Lisp

On Raspbian, I could not find a packaged Steel Bank Common Lisp (SBCL), and while GNU CLISP was available with apt-get and running fine, I could not get it to play nicely with Stumpwm's dependencies. Fear not, because Clozure CL is a Lisp of noble descent that can be optimized for the ARM processor. Follow the excellent instructions courtesy of renowned Lisp hacker Rainer Joswig.

http://lispm.dyndns.org/ccl

Act III
Install Stumpwm

Raspbian comes by default with LXDE, but we're after a lean, keyboard-only, Lisp-based, prefix driven à la Emacs, tiling window manager. Getting this right was actually the trickiest part, because none of the official instructions led to a working setup. I will spare you the failing strategies and the burnt hours, jumping straight to the winning combo, enabled by the heroic feats of Zach Beane and his Quicklisp project, a dependency management system Common Lispers had been waiting for since the dawn of the paren.

Download quicklisp.

$ curl -O http://beta.quicklisp.org/quicklisp.lisp

Install quicklisp.

(load "/path/to/quicklisp.lisp")
(quicklisp-quickstart:install)

Proceed to installing Stumpwm.

(ql:quickload "stumpwm")

In your CCL init file, make sure you defined a function to load quicklisp on demand, as Rainer Joswig recommends.

(defun load-quicklisp ()
  (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
                                         (user-homedir-pathname))))
    (when (probe-file quicklisp-init)
      (load quicklisp-init))))

Now we can load Stumpwm in X. Put the following in your .Xinitrc the following:

exec ccl -e "(load-quicklisp)" -e "(ql:quickload \"stumpwm\")" -e "(stumpwm:stumpwm)"

In conclusion

The Raspberry Pi has spawned renewed interest in non-mainstream OSes like RISC OS and Plan 9, but one can experiment delightfully as well while staying on the stock Raspbian. With a little bit of effort and a lot of imagination, there you are having a romance with a Lisp machine.

Author: Daniel Szmulewicz

Created: 2021-05-20 Thu 14:44

Validate