Open In App

How to Install LISP on MacOS?

Last Updated : 29 Oct, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

Lisp is one of the oldest programming languages. It was invented back in the 1950s by John McCarthy. Lisp is a so-called meta-programming language or a symbolic programming language. It can be used for any sort of task. It’s a general-purpose language. It is the second-oldest high-level programming language. In this tutorial, we are going to see how we can install LISP on macOS.

Installing LISP on macOS :

Install the SBCL, a lisp compiler by running the following command:

SBCL stands for Still Bank Common Lisp, it is a compiler for common lisp programming language.

brew install sbcl

Output:

 install sbcl

installing sbcl

Run the following command in the terminal to install lisp onto your macOS :

brew install clisp

Output: 

install clisp

installing clisp

Running a lisp program:

Open up any text editor and write the following hello world program and save it with extension as a .lisp.

; hello world program using the CLISP language

(print "Welcome to GeeksforGeeks")

Save it as a .lisp extension. E.g. save it as geeks.lisp.

Now to execute the code, run the following command:

sbcl --script geeks.lisp

Output:

Here, sbcl is a compiler, and the –script flag represents that we are going to run a lisp script file.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads