I recently followed instructions in the SLIME manual to get the inferior Lisp to load faster. The idea is simple: you dump a core for your implementation with swank already laoded, and you start SLIME with an adapted initialization (or it would force the loading of swank, which would redefine everything in it, which would in fact make it load slower than before…).
The problem was that with another encoding than the default one in SLIME/swank, the instructions in the SLIME manual are not enough. Also, by using common-lisp-controller from Debian, you can have the special core built for you and rebuilt everytime it’s needed (like when the implementation or swank are upgraded) automatically. I could make this work for SBCL, CMUCL and CLISP (currently ECL won’t load swank successfully, I suspect that when it does, this is usable with it as well).
Here’s what you need.
First, configure c-l-c: for each implementation, create a file with the name of the implementation in lowercase in “/etc/common-lisp/images”. So for SBCL, it would be “/etc/common-lisp/images/sbcl”. Add a line to the (possibly empty or non-existent) file with “swank”. You could the names of any other ASDF systems you want to see loaded everytime, one per line. I also add “iterate”, for example. To force the regeneration of the cores, just dpkg-reconfigure each implementation package. For SBCL, you would do “dpkg-reconfigure sbcl” as root.
Second, add an adapted initialization in SLIME’s configuration. The missing bit in SLIME’s manual is that you need to specify the encoding or the default one will be used by swank (IS-8859-1). If Emacs use another one like, say, UTF-8, sending any character with a code point above 128 will make you lose the connection to the inferior Lisp. Here’s my configuration:
(setq slime-lisp-implementations
`((sbcl ("sbcl")
:init (lambda (port-file _)
(format "(swank:start-server %S :coding-system \"utf-8-unix\")n" port-file)))
(cmucl ("lisp")
:init (lambda (port-file _)
(format "(swank:start-server %S :coding-system \"iso-latin-1-unix\")n" port-file)))
(clisp ("clisp")
:init (lambda (port-file _)
(format "(swank:start-server %S :coding-system \"utf-8-unix\")n" port-file)))
(ecl ("ecl") :coding-system iso-latin-1-unix)
(s48 ("scheme48") :init slime48-init-command)
,@slime-lisp-implementations)
With this setup, SBCL, CMUCL and CLISP are loaded blazingly fast, and I have nothing to worry about, everything is taken care of for me.