Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Lisp used for AI? [closed]

People also ask

Is LISP still good for AI?

So, yes, Lisp is still being used in artificial intelligence! However, it's also true that Python and C/C++ (to implement the low-level stuff) are probably the two most used programming languages in AI nowadays, especially for deep learning.

Why is LISP still used?

Lisp makes it remarkably easy to extend the language into just what you want it to be...which means that Lisp programmers tend to spend most of their time extending the language into just what they want it to be rather than solving the problem. (Indeed, this is often touted as one of the benefits of Lisp...

Why isn't LISP used more?

Even progressive companies willing to use a more powerful language usually don't choose LISP. This is because many of the newer languages try and compromise by borrowing powerful features from LISP, while staying easy to learn for the masses.

Is LISP better than Python for AI?

Lisp Programming language is not preferred much to work on Artificial Intelligence. Python programming language is much preferred to work on Artificial Intelligence. There is no community or support for Lisp Programming language users. There is a community to provide support to Python programming language users.


Lisp WAS used in AI until the end of the 1980s. In the 80s, though, Common Lisp was oversold to the business world as the "AI language"; the backlash forced most AI programmers to C++ for a few years. These days, prototypes usually are written in a younger dynamic language (Perl, Python, Ruby, etc) and implementations of successful research is usually in C or C++ (sometimes Java).

If you're curious about the 70's...well, I wasn't there. But I think Lisp was successful in AI research for three reasons (in order of importance):

  1. Lisp is an excellent prototyping tool. It was the best for a very long time. Lisp is still great at tackling a problem you don't know how to solve yet. That description characterises AI perfectly.
  2. Lisp supports symbolic programming well. Old AI was also symbolic. It was also unique in this regard for a long time.
  3. Lisp is very powerful. The code/data distinction is weaker so it feels more extensible than other languages because your functions and macros look like the built-in stuff.

I do not have Peter Norvig's old AI book, but it is supposed to be a good way to learn to program AI algorithms in Lisp.

Disclaimer: I am a grad student in computational linguistics. I know the subfield of natural language processing a lot better than the other fields. Maybe Lisp is used more in other subfields.


Lisp is used for AI because it supports the implementation of software that computes with symbols very well. Symbols, symbolic expressions and computing with those is at the core of Lisp.

Typical AI areas for computing with symbols were/are: computer algebra, theorem proving, planning systems, diagnosis, rewrite systems, knowledge representation and reasoning, logic languages, machine translation, expert systems, and more.

It is then no surprise that many famous AI applications in these domains were written in Lisp:

  • Macsyma as the first large computer algebra system.
  • ACL2 as a widely used theorem prover, for example used by AMD.
  • DART as the logistics planner used during the first Gulf war by the US military. This Lisp application alone is said to have paid back for all US investments in AI research at that time.
  • SPIKE, the planning and scheduling application for the Hubble Space Telescope. Also used by several other large telescopes.
  • CYC, one of the largest software systems written. Representation and reasoning in the domain of human common sense knowledge.
  • METAL, one of the first commercially used natural language translation systems.
  • American Express' Authorizer's Assistant, which checks credit card transactions.

There are thousands of applications in these areas that are written in Lisp. Very common for those is that they need special capabilities in the area of symbolic processing. One implements special languages that have special interpreters/compilers in these domains on top of Lisp. Lisp allows one to create representations for symbolic data and programs and can implement all kinds of machinery to manipulate these expressions (math formulas, logic formulas, plans, ...).

(Note that lots of other general purpose programming languages are used in AI, too. I have tried to answer why especially Lisp is used in AI.)


One reason is that it allows you to extend the language with constructs specific for your domain, making it, effectively, a domain specific language. This technique is incredibly powerful as it allows you to reason about the problem you are solving, rather than about shuffling bits.


My guess has always been that, being a functional language, it doesn't differentiate between code and data. Everything, including function definitions and function calls can be treated as lists and modified like any other piece of data.

So self-inspecting, self-modifying code could be written easily.


One possible answer is that AI is a collection of very hard problems, and Lisp is a good language for solving hard problems, not just AI.

As to why that is: macros, generic functions, and rich introspection allow for concise code and easy introduction of domain abstractions — it's a language that you can make more powerful. For a lot of problems that's unnecessary, and it comes with its own costs, but for other problems that power is needed to make any headway.