HACKER Q&A
📣 nyc111

Lisp and Artificial Intelligence


As mentioned in Wikipedia “LISP quickly became the favored programming language for artificial intelligence (AI) research.” What was the reason for this and what is the language favored for AI today?


  👤 GianFabien Accepted Answer ✓
I think that it is a partly historical note. Back in the 1960s and 1970s AI was more symbolic and logic processing. Prolog evolved to handle rules, etc. These days AI is more about extracting correlations from masses of examples (an obvious oversimplification). I doubt there is much Lisp in use by modern AI/ML systems.

👤 dtagames
Lisp is very good at dealing with lists of things and sentences are lists of words in Lisp naturally. Since text processing was an early goal for AI, Lisp lent itself well to that work.

In addition, the Lisp REPL is ideal for exploratory programming where it is not yet known what program needs to be written. Finally, Lisp is ideal for creating DSLs and these are also useful in AI and semantic work.


👤 thesuperbigfrog
History of Lisp by John McCarthy: http://jmc.stanford.edu/articles/lisp/lisp.pdf

https://en.wikipedia.org/wiki/Artificial_intelligence#AI_tex... shows modern AI textbooks.

"Artificial Intelligence: A Modern Approach, 4th US ed." (Book website: http://aima.cs.berkeley.edu/) Book's GitHub site shows multiple programming languages of which Lisp is included: https://github.com/aimacode


👤 mcswell
Not an answer to the original question, but Prolog later became a popular programming language for AI (mostly outside the US). It instantiated a particular search mechanism in a reasonably efficient way.

👤 ahefner
Lisp was the Python of its day, but more so - one of very few high level, garbage collected languages that were reasonably widespread. In Lisp you could explore data representations and novel control flows (search algorithms, nondeterminism, etc.) without getting bogged down in bits, bytes, and storage management, and s-expressions provided (and still provide) a reasonable middle ground representation for encoding complex structured data that both humans and machines can deal with.

👤 jerpint
Most AI today is generally some form of machine learning / deep learning. When it comes to deep learning, python is by far the most popular language (libraries like PyTorch and tensorflow have a thriving ecosystem)

👤 zelly
AI in those days was completely academic, so they used the in vogue academic language. It was a tribal thing—the same way HN gets excited when they see Rust. AI in the 1980s was centered around MIT, where everyone knew Lisp (actually Scheme) from the famous SICP course.

👤 scombridae
Most AI during that time revolved around minimax, i.e, the chess move I play should be a response to the move you'd play if you were me, which is the move I'd play if I were you, etc. Lisp's inherent recursiveness lent itself to that theme.

👤 dev_0
Python took over because it is easier to write than func lang