8

How can I install a Lisp (or Common Lisp) compiler in raspberry pi? I try sudo apt-get install lisp, sudo apt-get install common-lisp and can't find any related package. I also try to use lisp directly to verify if raspbian (is the system which I pretend to install the compiler) comes with any Lisp compiler.

Rainer Joswig
  • 248
  • 1
  • 7

4 Answers4

13

For Common Lisp there are quite a few free implementations available. The following are working on the Raspberry Pi or similar ARM-based computers with GNU/Linux:

Free:

  • Clozure CL (CCL), 32bit, fast/compact native code compiler
  • SBCL, fast native code compiler
  • Embedded Common Lisp (ECL), uses a C compiler for code generation
  • GNU CLISP, small footprint due to its own virtual machine
  • ABCL, runs on top of the JVM (the Java Virtual Machine)
  • GNU Common Lisp (GCL), uses a C compiler for code generation

Commercial/proprietary:

  • Allegro CL, 64bit
  • LispWorks, 32bit and 64bit, fast native code compiler with GUI toolkit supporting GTK+ and integrated development environment

For all above GNU Emacs (the editor), SLIME (the Lisp development environment extension for Emacs) and Quicklisp (a software library manager for Common Lisp) will provide a useful development environment.

If you want to learn Lisp programming, I recommend to use SBCL. It's freely available, widely used and has the best compiler. The SBCL compiler can give a lot of feedback and warns about many problems (like syntax errors and undefined variables/functions).

Example Setup with Clozure Common Lisp

I've described how you get and set up Clozure Common Lisp together with Emacs/SLIME/Quicklisp for use on a Raspberry Pi and similar computers:

http://lispm.de/ccl

Clozure CL is a full featured Common Lisp implementation with a quick compiler which generates native ARM code. You'll also get fast start up times and a relatively small memory footprint.

Actually the page above was running on a Raspberry Pi. It currently runs on an ODROID - which is also ARM-based and also runs Ubuntu GNU Linux. It uses LispWorks and a lisp-based web server. I serve it from home with a VDSL connection, so just try it later if it is not available...

Rainer Joswig
  • 248
  • 1
  • 7
  • 2
    I can confirm that Rainer's method works, as I followed his instructions successfully a few months ago to get CCL up and running. CLisp also installs. There is no successful arm port of SBCL so far though. – Amos Aug 25 '13 at 20:20
7

Use apt-cache when searching, e.g.:

apt-cache search lisp

Linux and lisp actually go way back (some folks at GNU are fond of it and it is fundamental to things like emacs and gimp), so you'll see a decent list. I'm not a user myself, but the actual implementation on raspbian appears to be clisp; apt-get install clisp should get you what you want.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
0

I am making an interpreter compiler for ISLisp. As it is small, it works lightly with Raspberry pi. Check out the youtube video. https://www.youtube.com/watch?v=KfrRyKMcTw8&t=37s Published on github. https://github.com/sasagawa888/eisl

0

Clisp is available from the Raspbian repositories and is easily installable with

sudo apt-get install clisp

I would also recommend installing Emacs as a powerful Lisp-aware text editor and install Slime to help with running the Common Lisp interpreter (the clisp REPL) from within Emacs.

sudo apt-get install emacs slime

Another alternative available from the repositories is SBCL, an even more powerful Lisp compiler, although it's error messages and debugger maybe a hair less user friendly then Clisp, at least for a newbie. It is fast becoming the standard Lisp compiler for most Lisp users.

Debian (and therefore Raspbian) takes care of installing Slime and integrating it with Emacs and clisp so entering M-x slime within emacs will start a REPL within emacs. If you are not comfortable with Emacs, I would suggest starting with the Emacs tutorial, hit Ctrl-h t once inside Emacs; in other words hit the Ctrl and 'h' keys simultaneously followed by the 't' key alone and that should launch the built in Emacs tutorial. Enjoy.

haziz
  • 235
  • 1
  • 3
  • 8