7 ms·
Ask HN: 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?
- thesuperbigfrog 4y agoHistory of Lisp by John McCarthy: http://jmc.stanford.edu/articles/lisp/lisp.pdf http://jmc.stanford.edu/articles/lisp/lisp.pdf https://en.wikipedia.org/wiki/Artificial_intelligence#AI_textbooks 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/ http://aima.cs.berkeley.edu/) Book's GitHub site shows multiple programming languages of which Lisp is included: https://github.com/aimacode https://github.com/aimacode
- scombridae 4y agoMost 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.
- deleted 4y ago[deleted]
- dtagames 4y agoLisp 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.
- jerpint 4y agoMost 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)
- DontchaKnowit 4y agoAlways wondered why this was the case : python is painfully slow and machine learning benefits greatly from speed.
- pizza 4y agoThe Python ecosystem imo tries to get you from 0 to 1 a bit faster than the more performant alternatives with large userbases I’m really thinking of the C/C++ ecosystem here - os portability, compiler differences, cmake, xeus-cling vs ipython, etc. Interestingly it seems nowadays the trend is to siphon the good parts of the faster languages into Python (xla/numba/tvm) for cheap, rather than making it easier to get the good parts of Python into the faster languages (although certainly eg pybind11 is nice in that regard).
- rsfern 4y agoIt’s nice and flexible to work with, and for large models all the heavy lifting is calling out to CUDA and C++. often the overhead of the python interpreter is completely negligible
- dusted 4y agoit's my understanding that python is more used as a user interface to the actual AI programs, which are mostly written in some GPU-friendly language, so Python is more for menial work that can be slow because it's just doing minor tranformations to data that's being passed to and from the actual programs.. But yeah, python is painfully slow, write a naive "count the lines in a textfile" program in C and Python, you're in for a bad time waiting for python to finish.. even with small files of 100 gigabytes..
- jstx1 4y agoNo, Python is much more than an interface - the model architercture and definition happens in Python. If you're writing an ML algorithm, you're writing it in Python, it's just that the lower level operations are implemented in something like C++.
- mcswell 4y agoNot 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.
- GianFabien 4y agoI 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.
- ahefner 4y agoLisp 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.
- zelly 4y agoAI 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.
- dev_0 4y agoPython took over because it is easier to write than func lang