40
$\begingroup$

I've heard before from computer scientists and from researchers in the area of AI that that Lisp is a good language for research and development in artificial intelligence.

  • Does this still apply, with the proliferation of neural networks and deep learning?
  • What was their reasoning for this?
  • What languages are current deep-learning systems currently built in?
$\endgroup$

3 Answers 3

35
$\begingroup$

First, I guess that you mean Common Lisp (which is a standard language specification, see its HyperSpec) with efficient implementations (à la SBCL). But some recent implementations of Scheme could also be relevant (with good implementations such as Bigloo or Chicken/Scheme). Both Common Lisp and Scheme (and even Clojure) are from the same Lisp family. And as a scripting language driving big data or machine learning applications, Guile might be a useful replacement to Python and is also a Lisp dialect. BTW, I do recommend reading SICP, an excellent introduction to programming using Scheme.

Then, Common Lisp (and other dialects of Lisp) is great for symbolic AI. However, many recent machine learning libraries are coded in more mainstream languages, for example TensorFlow is coded in C++ & Python. Deep learning libraries are mostly coded in C++ or Python or C (and sometimes using OpenCL or Cuda for GPU computing parts).

Common Lisp is great for symbolic artificial intelligence because:

  • it has very good implementations (e.g. SBCL, which compiles to machine code every expression given to the REPL)
  • it is homoiconic, so it is easy to deal with programs as data, in particular it is easy to generate [sub-]programs, that is use meta-programming techniques.
  • it has a Read-Eval-Print Loop to ease interactive programming
  • it provides a very powerful macro machinery (essentially, you define your own domain specific sublanguage for your problem), much more powerful than in other languages like C.
  • it mandates a garbage collector (even code can be garbage collected)
  • it provides many container abstract data types, and can easily handle symbols.
  • you can code both high-level (dynamically typed) and low-level (more or less startically typed) code, thru appropriate annotations.

However most machine learning & neural network libraries are not coded in CL. Notice that neither neural network nor deep learning is in the symbolic artificial intelligence field. See also this question.

Several symbolic AI systems like Eurisko or CyC have been developed in CL (actually, in some DSL built above CL).

Notice that the programming language might not be very important. In the Artificial General Intelligence research topic, some people work on the idea of a AI system which would generate all its own code (so are designing it with a bootstrapping approach). Then, the code which is generated by such a system can even be generated in low level programming languages like C. See J.Pitrat's blog, which has inspired the RefPerSys project.

$\endgroup$
1
  • 2
    $\begingroup$ I'd like to add here, that tensorflow and theano are based on computational graphs, which is actually symbolic programming, but within imperative language. $\endgroup$
    – Maxim
    Commented Oct 9, 2017 at 9:50
18
$\begingroup$

David Nolen (contributor of Clojure and ClojureScript; creator of Core Logic a port of miniKanren) in a talk called LISP as too powerful stated that back in his days LISP was decades ahead of other programming languages. There are number of reasons why the language wasn't able to maintain its initial reputation.

This article highlights some key points why LISP is good for AI

  • Easy to define a new language and manipulate complex information.
  • Full flexibility in defining and manipulating programs as well as data.
  • Fast, as the program is concise along with low-level detail.
  • Good programming environment (debugging, incremental compilers, editors).

Most of my friends in this field usually use Matlab for Artificial Neural Networks and Machine Learning. It hides the low-level details though. If you are only looking for results and not how you get there, then Matlab will be good. But if you want to learn even low-level detailed stuff, then I will suggest you go through LISP at-least once.

The language might not be that important if you have an understanding of various AI algorithms and techniques. I will suggest you read "Artificial Intelligence: A Modern Approach (by Stuard J. Russell and Peter Norvig". I am currently reading this book, and it's a very good book.

$\endgroup$
5
$\begingroup$

AI is a wide field

AI is a wide field that goes far beyond machine learning, deep learning, neural networks, etc. In some of these fields, the programming language does not matter at all (except for speed issues), so using Lisp would certainly not be an issue there.

Planning systems

In search or AI planning, for instance, standardised and commonly used languages, like C++ and Java, are often the first choice, because they are fast (in particular C++) and because many software projects like planning systems are open source, using a commonly used language is likely to get more feedback or contributions. On the other hand, Common Lisp ecosystem is welcoming, the language is also standardised, and there is a LONG history in AI research using Lisp.

I am only aware of one single planner that is written in Lisp. Just to give some impression about the role of the choice of the programming language in this field of AI, I'll give a list of some of the best-known and therefore most-important planners:

Fast-Downward

This is probably the best-known classical planning system, which is written in C++ and some parts (pre-processing) in Python.

Fast-Forward

Together with Fast-Downward, this is the classical planning system everyone knows. It's written in C.

VHPOP

This is one of the best-known partial-order causal link (POCL) planning systems. It's written in C++.

SHOP and SHOP2

This is the best-known HTN (hierarchical) planning system. There are two versions: SHOP and SHOP2. The original versions have been written in Lisp. Newer versions (called JSHOP and JSHOP2) have been written in Java. Pyshop is a further SHOP variant written in Python.

PANDA

This is another well-known HTN (and hybrid) planning system. There are different versions of the planner, PANDA1 and PANDA2, which are written in Java. PANDA3 is written primarily in Java, with some parts being in Scala.

These were just some of the best-known planning systems that came to my mind. More recent ones can be retrieved from the International Planning Competitions (IPCs), which take place every two years. The competing planners' codes are published open-source (for a few years).

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .