Lisp Hello World Example: How To Write and Execute Lisp Program on Linux OS

by Ramesh Natarajan on December 18, 2009

Question: I would like to understand the basics of how to write and execute Lisp program on Linux OS. Can you explain it with a simple example?

Answer: In this article, let us review very quickly how to write a basic Hello World Lisp program and execute Lisp program on Linux or Unix OS.

1. Write a Hello World Lisp Program

Create the helloworld program using the Vim editor as shown below.

$ vim helloworld.lisp

; hello world lisp program.
(print "Hello World")

Note: Comment in Lisp starts with ;

2. Make sure Lisp Interpreter is installed on your system

Make sure Lisp interpreter clisp is installed on your system as shown below.

$ which clisp
/usr/bin/clisp

Installing clisp interpreter/compiler

If you don’t have Lisp interpreter, install it as shown below.

$ sudo apt-get install clisp

3. Execute the Lisp Program

You can execute using clisp helloworld

$ clisp helloworld

"Hello World" 

Note: As Lisp program is interpreted, we don’t have the compilation step similar to the C program.

4. Lisp Tutorial

Refer to An Introduction and Tutorial for Common Lisp for additional Lisp information.

Download Free eBook - Linux 101 Hacks

Get free Unix tutorials, tips and tricks straight to your email in-box.

If you enjoyed this article, you might also like..

  1. Lua Hello World Example: How To Write and Execute Lua Program on Linux OS
  2. Tcl Hello World Example: How To Write, Compile and Execute Tcl Program on Linux OS
  3. XQuery Hello World Example: How To Write and Execute XQuery Program on Linux OS
  4. Forth Hello World Example: How To Write and Execute Forth Program on Linux OS
  5. Ruby Hello World Example: How To Write and Execute Ruby Program on Unix OS
  

Vim 101 Hacks Book

Leave a Comment

Previous post:

Next post: