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?
Archana David's user avatar
Archana David
2872 silver badges9 bronze badges
askedOct 31, 2016 at 3:38
Alecto's user avatar
$\endgroup$

3 Answers3

34
$\begingroup$

First, I guess that you meanCommon Lisp (which is a standard language specification, see itsHyperSpec) with efficient implementations (à laSBCL). But some recent implementations ofScheme could also be relevant (with good implementations such asBigloo orChicken/Scheme). Both Common Lisp and Scheme (and evenClojure) are from the same Lisp family. And as a scripting language driving big data or machine learning applications,Guile mightbe a useful replacement to Python and is also a Lisp dialect. BTW, I do recommend readingSICP, 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 exampleTensorFlow is coded in C++ & Python.Deep learning libraries are mostly coded in C++ or Python or C (and sometimes usingOpenCL or Cuda for GPU computing parts).

Common Lisp is great forsymbolic artificial intelligence because:

  • it has very goodimplementations (e.g.SBCL, which compiles to machine code every expression given to theREPL)
  • it ishomoiconic, so it is easy to deal with programs as data, in particular it is easy to generate [sub-]programs, that is usemeta-programming techniques.
  • it has aRead-Eval-Print Loop to ease interactive programming
  • it provides a very powerfulmacro machinery (essentially, you define your own domain specific sublanguage for your problem), much more powerful than in other languages like C.
  • it mandates agarbage collector (even code can be garbage collected)
  • it provides manycontainer 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 alsothis question.

Several symbolic AI systems likeEurisko orCyC have been developed in CL (actually, in some DSL built above CL).

Notice that the programming language might not be very important. In theArtificial 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 abootstrapping approach). Then, the code which is generated by such a system can even be generated in low level programming languages like C. SeeJ.Pitrat's blog, which has inspired theRefPerSys project.

answeredOct 31, 2016 at 6:54
Basile Starynkevitch's user avatar
$\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$CommentedOct 9, 2017 at 9:50
17
$\begingroup$

David Nolen (contributor ofClojure andClojureScript; creator of Core Logic a port of miniKanren) in a talk calledLISP as too powerful stated that back in his days LISP was decades ahead of other programming languages. There arenumber 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.

nbro's user avatar
nbro
43.1k14 gold badges121 silver badges222 bronze badges
answeredOct 31, 2016 at 9:15
Ugnes's user avatar
$\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 theInternational Planning Competitions (IPCs), which take place every two years. The competing planners' codes are published open-source (for a few years).

answeredMar 9, 2017 at 11:22
Prof.Chaos's user avatar
$\endgroup$

You mustlog in to answer this question.

Protected question. To answer this question, you need to have at least 10 reputation on this site (not counting theassociation bonus). The reputation requirement helps protect this question from spam and non-answer activity.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.