Common Lisp: Intro, Resources, and FAQ
Introduction
Common Lisp is a dialect of Lisp, one of the most interesting languages in the world of computer programming.
Lisp was invented in 1961. It is the second oldest language still in common use, after Fortran — and, while Fortran continues to slowly fade away, Lisp is still a very important part of the computer science landscape.
The language is unique in several ways. Every expression in Lisp is a list, one of two primary data types in the language. Since the code itself can be evaluated as a datatype in the language, Lisp lends itself to recursion and introspection.
Moreover — unlike most other languages — Lisp code is a human-readable version of the actual data structure as it is processed by the underlying Lisp system. This means there is a high-degree of similarity between how a programmer thinks about a program, and what the program is actually doing “under the hood.”
Lisp can be used for any number of applications and problem domains, but it is especially useful for Artificial Intelligence and Machine Learning.
Common Lisp Resources
Books
There are very few online tutorials for Common Lisp, so if you really want to learn the language you’ll need to consult one or more books. Fortunately, there are online editions of many of these.
- Common LISP: A Gentle Introduction to Symbolic Computation
- ANSI Common LISP
- Practical Common Lisp
- On Lisp: Advanced Techniques for Common Lisp
- Successful Lisp: How to Understand and Use Common Lisp
- Object-Oriented Programming in COMMON LISP: A Programmer’s Guide to CLOS
- The Art of the Metaobject Protocol
- Lisp in Small Pieces
- The Elements of Artificial Intelligence Using Common LISP
- Let Over Lambda
Many of the most important and influential books on Lisp were written in the 1970s and 1980s, and are now out of print and hard to find. Several of these books have been made available online, and you can find links to them below.
Online Resources
Of Historic Interest
Lisp is a historically interesting language. Its development is closely tied to the development of Artificial Intelligence and machine learning. It is also one of the most unique languages in common use, with a syntax and internal logic wildly different than most other languages. These differences are part of ongoing debates within the computer science community about the nature of computation and the proper grammar for programming.
Anyone who is taking the time to learn Common Lisp today should make it a point to explore some of the language’s history.
- Recursive Functions of Symbolic Expressions and Their Computation by Machine — Written in 1960, by John McCarthy. This is the original paper describing what would become LISP.
- A Basis for a Mathematical Theory of Computation — A paper written by McCarthy in 1961, exploring many of the ideas from the “Recursive Functions” paper. Also see the companion paper, Towards a Mathematical Science of Computation.
- LISP — Notes on its Past and Future — McCarthy wrote this article in 1980, 20 years after Lisp was released.
- VIDEO: Artificial Intelligence
John McCarthy (1927-2011) was a long-time Professor of Computer Science at Stanford University. His home page is a treasure-trove of interesting articles on AI, LISP, theoretical computer science, and related topics.
Learn Lisp
There are not very many online tutorials for Common Lisp, as there are for more popular languages like PHP or Ruby. However, there are a lot of books on Lisp which have been released as online editions.
Many of these were written in the 1970s and 80s, though there are certainly some more contemporary resources as well.
- On Lisp — Online edition of the excellent book by Paul Graham.
- Successful Lisp: How to Understand and Use Common Lisp
- Common Lisp: A Gentle Introduction to Symbolic Computation
- Lisp in Small Parts — A series of short tutorials
- Practical Common Lisp — A complete online edition of the classic introductory book of the same name.
- Land of Lisp — A funny, idiosyncratic website and book, teaching people how to use Lisp.
- Learn Common Lisp — Learn X in Y minutes, where X = Common Lisp.
- ELM-ART Lisp Course — Learn to use Lisp with the Episodic Learner Model at the Adaptive Remote Tutor
- Lisp Quickstart
- LispTutor Jr
- Casting SPELs in LISP
- COMMON LISP: An Interactive Approach
- Lisp Style Tips for the Beginner
- Pascal Costanza’s Highly Opinionated Guide to Lisp
Required reading:
- State of the Common Lisp Ecosystem — Once you’ve picked up a little bit of Common Lisp, make sure you read Fernando Borretti’s detailed coverage on the Lisp development ecosystem.
Lisp Reference and Documentation
More than even most other languages, if you start working with Lisp you will find yourself needing to consult reference material on a frequent basis. Here are some of the more commonly used Common Lisp reference works available online.
- Common Lisp Wikibook
- Common Lisp HyperSpec
- Cliki: The Common Lisp Wiki
- LispWorks Common Lisp Documentation
- lispdoc — Lisp documentation.
- Common Lisp Cookbook
- Google Common Lisp Style Guide — How to write Common Lisp the way Google writes Common Lisp. (Did you even know that Google was writing Common Lisp?)
- Common Lisp the Language
Special Topics in Lisp Programming
Lisp is, on its own merits, a fairly specialized language. Here are a few resources on particularly specialized issues in Common Lisp.
- Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp — Also check out the book.
- Common Lisp Object System
Lisp Tools
If you want to accomplish anything of major substance with Common Lisp, you’ll need a larger ecosytem of language support — libraries, plugins, development tools, frameworks.
Here are some of the most popular tools that Lispers use to get things done.
- ACL2 — A Computational Logic for Applicative Common Lisp
- Reader Macros in Common Lisp — Reader macros allow you to create entirely new syntax on top of Lisp
- Quicklisp — Library manager for Common Lisp
- Clack — A web application environment for Common Lisp. Several web application frameworks have been built on top of it:
- Parenscript — Translates Common Lisp to Javascript
- jscl — Another Common Lisp to JavaScript compiler
- Roswell — Command line installer for Common Lisp
- CommonQT — An Common Lisp extension for QtTools, providing a GUI solution.
- CLML — Common Lisp Machine Learning library
- MGL — Anoth machine-learning library
- Antik — library providing tools for scientific and engineering computation
- Crane — an ORM for Common Lisp.
- cl-dbi — Database abstraction layer
- CEPL — Graphics library. (Check out their extensive video tutorial series.)
- Iron Clad — Cryptography tools.
- SLIME — The standard IDE for Common Lisp.
Lisp Culture and Community
More than any other language, Lisp has its own culture — unique lore, humor, and tradition. Some of this goes back to its roots in computer science departments of universities, some of it is related to early geek hacker culture, and some of it is a result of the peculiarities of the language itself and the types of applications it is commonly used for.
If you really want to understand Lisp, you can’t just learn the language — you have to learn the culture and become a part of this (weird and wonderful) community.
- Lisp Forum
- Workshop on the Psychological Reality of Lisp
- Poetry about Lisp and related topics
- Quotes about Lisp
- A conversation with Alan Kay
- Eternal Flame
- Lisp Humor
- Common Lisp Movie
- Land of Lisp Music Video
- Planet Lisp
- Lisp Meetings — also check out [@lispmeetings on Twitter](https://twitter.com/lispmeetings)
Required Reading:
- Gödel, Escher, Bach: An Eternal Golden Braid, by Douglas R. Hofstadter — This book is not directly related to Lisp (though it does talk about it a little bit). But it’s a hugely important cultural and intellectual touchstone for people in a number of different domains that Lisp inhabits: artificial intelligence, machine learning, mathematical logic, and recursion. This book will change the way you think, and you’ll end up thinking more like the kind of person who uses Lisp.
Common Lisp Implementations
Lisp is an idea, and Common Lisp is a language — it is not a specific technology. The following are some of the more popular implementation of Common Lisp.
- Clisp — GNU Clisp, an implementation of ANSI Common Lisp
- GCL — Another Common Lisp implementation
- CMUCL — a high-performance, free Common Lisp implementation. The Hemlock editor is included.
- Allegro CL
- Clozure Common Lisp
- Steel Bank Common Lisp
Videos
Learn about Lisp by watching. These videos run the gamut from basic tutorials to in-depth explorations of Lisp logic and philosophy.
- Thinking Like a Lisp Programmer
- Practical Common Lisp — Google Tech Talk
- A Brief Introduction to LISP
- Lisp — Google Tech Talk
- Common Lisp: why macros are great
- Common Lisp – How to Start a New Project
- Interactive game development with common lisp
- LiveCoding in CommonLisp
- Patrick Stein on Vimeo
- Common Lisp Tutorials by Baggers
Related Languages and Dialects
Lisp is not a single language, but a family of languages — an idea about how to do computer programming. Common Lisp is the most popular implementation of Lisp, but several others exist.
The major dialects of Lisp are:
- Scheme — Scheme is the leading “competitor” to Common Lisp.
- Clojure — Clojure is a Lisp dialect that is currently gaining popularity. It is built to run in the Java Virtual Machine.
Common Lisp FAQ
What is Lisp?
Lisp is a family of computer programming languages which were first developed in the late 1950s. Lisp stands for List Processing, a name referring to the fact that the languages uses lists as its primary data structure, and also for its programming syntax.
What is Common Lisp?
Common Lisp is a dialect of Lisp that was developed in the early 1980s, as an attempt to create a single (common) version of Lisp. It is one of the two most popular versions of the language (along with Scheme).
What is Lisp used for?
Lisp can be used for any type of application, but it is of particular interest for Artificial Intelligence, machine learning, and other forms of advanced programming which require recursive logic.
Why is Lisp popular with Artificial Intelligence?
There are at least two reasons for this.
First, Lisp’s primary data structure (the list) is also the structure of its programming syntax. That is, data and instructions about data take the same form. (This is called homoiconicity.)
This means that Lisp can be used to analyse its itself, or to modify itself. Many experts in the field of Artificial Intelligence, as well as many philosophers and thinkers in related domains, consider this type of recursive introspection to be the foundation for real, self-aware intelligence. Moreover, the ability for a program to change itself based on input is the essence of machine learning.
A second reason for Lisp’s popularity in AI is that the control syntax for the language is closely analogous to the computational logic underlying it. This gives Lisp programmers a much deeper insight into how a computer is actually interpreting the logic and syntax of the program than is possible with other languages.