7

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.

  • 1
    Emacs? Scheme? Clojure? – Thorbjørn Ravn Andersen Aug 22 '13 at 19:46
  • Clojure runs on a java virtual machine and it implicates install the jvm on raspberry. But clojure have some notables differences such a syntax rules. I'm searching some related to the original lisp. – Wronski Aug 23 '13 at 15:59
  • The answer depends on what you need it for. Scheme is good for learning. – Thorbjørn Ravn Andersen Aug 23 '13 at 16:55
11

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...

  • 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.

  • Thanks! it's just what I need. Sorry, I can't vote-up you (my reputation is insufficient). – Wronski Aug 23 '13 at 16:01
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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.