Open In App

How to Install LISP on Linux?

Last Updated : 22 May, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

LISP (List programming) is the second-oldest high-level programming language after Fortran. It has a fully parenthesized prefix notation.

Installing LISP on Linux:

Follow the below steps to install LISP on Linux:

Step 1: Install SBCL compiler.

Steel Bank Common Lisp (SBCL) is the most common Lisp compiler. It is open-source and it provides a compiler, runtime, and an interactive environment including a debugger, a statistical profiler, a code coverage tool, and many other extensions.
Install it via the following command (Enter password when prompted):

sudo apt-get update
sudo apt-get -y install sbcl

For arch linux, you can use the following command:

sudo pacman --noconfirm -S sbcl
Installing SBCL compiler

Step 2: Now Install Quicklisp package manager

sudo apt-get -y install curl
curl -o /tmp/ql.lisp http://beta.quicklisp.org/quicklisp.lisp
sbcl --no-sysinit --no-userinit --load /tmp/ql.lisp \
--eval '(quicklisp-quickstart:install :path "~/.quicklisp")' \
--eval '(ql:add-to-init-file)' \
--quit
https://media.geeksforgeeks.org/wp-content/uploads/20211005170231/part1.jpghttps://media.geeksforgeeks.org/wp-content/uploads/20211005170309/part2.jpg

Step 3: Now Install the text editor or IDE of your choice

You can use any text editor for editing lisp files. Some popular options are VS code, SLIME, EMACS, Vim, etc.

Suggested extensions for VS code:

  • Common Lisp
  • Code runner
     

Example:

Here we save the file as filename.lisp eg. test.lisp. 

Lisp
(write-line "Hello Geeksforgeeks")


Navigate to the file location and run it using the command: 

sbcl --script filename.lisp
For example:
sbcl --script test.lisp

Output:

output

Next Article

Similar Reads