Answers.Body: <p>David Nolen (contributor of <a href="https://fr.wikipedia.org/wiki/Clojure" rel="nofollow noreferrer">Clojure</a> and <a href="https://github.com/clojure/clojurescript" rel="nofollow noreferrer">ClojureScript</a>; creator of Core Logic a port of miniKanren) in a talk called <strong>LISP as too powerful</strong> stated that back in his days LISP was decades ahead of other programming languages. There are <a href="http://blog.samibadawi.com/2013/05/lisp-prolog-and-evolution.html" rel="nofollow noreferrer">number of reasons</a> why the language wasn't able to maintain its initial reputation.</p>
  <p><a href="http://norvig.com/paip-preface.html" rel="nofollow noreferrer">This</a> article highlights some key points why LISP is good for AI</p>
  <ul>
  <li>Easy to define a new language and manipulate complex information.</li>
  <li>Full flexibility in defining and manipulating programs as well as data.</li>
  <li>Fast, as the program is concise along with low-level detail.</li>
  <li>Good programming environment (debugging, incremental compilers, editors).</li>
  </ul>
  <p>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.</p>
  <p>The language might not be that important if you have an understanding of various AI algorithms and techniques. I will suggest you read <em>&quot;Artificial Intelligence: A Modern Approach (by Stuard J. Russell and Peter Norvig&quot;</em>. I am currently reading this book, and it's a very good book.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2016-10-31T09:15:42.313Z
Answers.LastActivityDate: 2021-01-17T20:36:15.830Z
Answers.LastEditDate: 2021-01-17T20:36:15.830Z
Answers.UserDisplayName: Ugnes
Answers.Body: <h2>AI is a wide field</h2>
  <p>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.</p>
  <h2>Planning systems</h2>
  <p>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.</p>
  <p>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:</p>
  <h3><a href="http://www.fast-downward.org/" rel="nofollow noreferrer">Fast-Downward</a></h3>
  <p>This is probably the best-known classical planning system, which is written in C++ and some parts (pre-processing) in Python.</p>
  <h3><a href="https://fai.cs.uni-saarland.de/hoffmann/ff.html" rel="nofollow noreferrer">Fast-Forward</a></h3>
  <p>Together with Fast-Downward, this is the classical planning system everyone knows. It's written in C.</p>
  <h3><a href="http://www.tempastic.org/vhpop/" rel="nofollow noreferrer">VHPOP</a></h3>
  <p>This is one of the best-known partial-order causal link (POCL) planning systems. It's written in C++.</p>
  <h3><a href="https://www.cs.umd.edu/projects/shop/" rel="nofollow noreferrer">SHOP and SHOP2</a></h3>
  <p>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.</p>
  <h3><a href="http://www.uni-ulm.de/en/in/ki/research/software/panda/panda-planning-system/" rel="nofollow noreferrer">PANDA</a></h3>
  <p>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.</p>
  <p>These were just some of the best-known planning systems that came to my mind. More recent ones can be retrieved from the <a href="http://www.icaps-conference.org/index.php/Main/Competitions" rel="nofollow noreferrer">International Planning Competitions (IPCs)</a>, which take place every two years. The competing planners' codes are published open-source (for a few years).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2017-03-09T11:22:29.873Z
Answers.LastActivityDate: 2023-01-18T01:03:13.987Z
Answers.LastEditDate: 2023-01-18T01:03:13.987Z
Answers.UserDisplayName: Prof.Chaos
Answers.Body: <p>First, I guess that you mean <a href="https://en.wikipedia.org/wiki/Common_Lisp" rel="nofollow noreferrer">Common Lisp</a> (which is a standard language specification, see its <a href="http://www.lispworks.com/documentation/HyperSpec/Front/" rel="nofollow noreferrer">HyperSpec</a>) with efficient implementations (à la <a href="https://sbcl.org/" rel="nofollow noreferrer">SBCL</a>). But some recent implementations of <a href="https://schemers.org/" rel="nofollow noreferrer">Scheme</a> could also be relevant (with good implementations such as <a href="https://www-sop.inria.fr/mimosa/fp/Bigloo/" rel="nofollow noreferrer">Bigloo</a> or <a href="https://www.call-cc.org/" rel="nofollow noreferrer">Chicken/Scheme</a>). Both Common Lisp and Scheme (and even <a href="https://clojure.org/" rel="nofollow noreferrer">Clojure</a>) are from the same Lisp family. And as a scripting language driving big data or machine learning applications, <a href="https://www.gnu.org/software/guile/" rel="nofollow noreferrer">Guile</a> might <a href="http://starynkevitch.net/Basile/guile-tutorial-1.html" rel="nofollow noreferrer">be</a> a useful replacement to Python and is also a Lisp dialect. BTW, I do recommend reading <a href="https://mitpress.mit.edu/sites/default/files/sicp/index.html" rel="nofollow noreferrer">SICP</a>, an excellent introduction to programming using Scheme.</p>
  
  <p>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 <a href="https://en.wikipedia.org/wiki/TensorFlow" rel="nofollow noreferrer">TensorFlow</a> is coded in C++ &amp; Python. <a href="http://machinelearningmastery.com/popular-deep-learning-libraries/" rel="nofollow noreferrer">Deep learning libraries</a> are mostly coded in C++ or Python or C (and sometimes using <a href="https://en.wikipedia.org/wiki/OpenCL" rel="nofollow noreferrer">OpenCL</a> or Cuda for GPU computing parts).</p>
  
  <p>Common Lisp is great for <a href="https://en.wikipedia.org/wiki/Symbolic_artificial_intelligence" rel="nofollow noreferrer">symbolic artificial intelligence</a> because:</p>
  
  <ul>
  <li>it has very good <em>implementations</em> (e.g. <a href="http://sbcl.org/" rel="nofollow noreferrer">SBCL</a>, which compiles to machine code every expression given to the <a href="https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop" rel="nofollow noreferrer">REPL</a>)</li>
  <li>it is <a href="https://en.wikipedia.org/wiki/Homoiconicity" rel="nofollow noreferrer"><strong>homoiconic</strong></a>, so it is easy to deal with programs as data, in particular it is easy to generate [sub-]programs, that is use <a href="https://en.wikipedia.org/wiki/Metaprogramming" rel="nofollow noreferrer">meta-programming</a> techniques.</li>
  <li>it has a <a href="https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop" rel="nofollow noreferrer">Read-Eval-Print Loop</a> to ease interactive programming</li>
  <li>it provides a very powerful <a href="https://en.wikipedia.org/wiki/Macro_%28computer_science%29" rel="nofollow noreferrer">macro</a> machinery (essentially, you define your own domain specific sublanguage for your problem), much more powerful than in other languages like C.</li>
  <li>it mandates a <a href="https://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29" rel="nofollow noreferrer">garbage collector</a> (even code can be garbage collected)</li>
  <li>it provides many <a href="https://en.wikipedia.org/wiki/Container_%28abstract_data_type%29" rel="nofollow noreferrer">container</a> abstract data types, and can easily handle symbols.</li>
  <li>you can code both high-level (dynamically typed) and low-level (more or less startically typed) code, thru appropriate annotations.</li>
  </ul>
  
  <p>However most machine learning &amp; 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 <a href="https://ai.stackexchange.com/q/35/3335">this question</a>.</p>
  
  <p>Several symbolic AI systems like <a href="https://en.wikipedia.org/wiki/Eurisko" rel="nofollow noreferrer">Eurisko</a> or <a href="https://en.wikipedia.org/wiki/Cyc" rel="nofollow noreferrer">CyC</a> have been developed in CL (actually, in some DSL built above CL).</p>
  
  <p>Notice that the programming language might not be very important. In the <a href="https://en.wikipedia.org/wiki/Artificial_general_intelligence" rel="nofollow noreferrer">Artificial General Intelligence</a> 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 <a href="https://en.wikipedia.org/wiki/Bootstrapping_%28compilers%29" rel="nofollow noreferrer">bootstrapping</a> approach). Then, the code which is generated by such a system can even be generated in low level programming languages like C. See <a href="http://bootstrappingartificialintelligence.fr/WordPress3/" rel="nofollow noreferrer">J.Pitrat's blog</a>, which has inspired the <a href="https://refpersys.org/" rel="nofollow noreferrer">RefPerSys</a> project.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-09T09:50:43.367Z
Answers.Text: I'd like to add here, that tensorflow and theano are based on computational graphs, which is actually symbolic programming, but within imperative language.
Answers.UserDisplayName: Maxim
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2016-10-31T06:54:35.370Z
Answers.LastActivityDate: 2020-01-01T21:23:09.887Z
Answers.LastEditDate: 2020-01-01T21:23:09.887Z
Answers.UserDisplayName: Basile Starynkevitch
Body: <p>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.</p>
  <ul>
  <li>Does this still apply, with the proliferation of neural networks and deep learning?</li>
  <li>What was their reasoning for this?</li>
  <li>What languages are current deep-learning systems currently built in?</li>
  </ul>
  
Tags: <neural-networks><machine-learning><deep-learning><research><programming-languages>
Title: Why is Lisp such a good language for AI?
UserDisplayName: Alecto
ThreadText: # Why is Lisp such a good language for AI?
  
  (Asked by: username_0 on 2016-10-31)
  
  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?
  
  **Tags:** neural-networks, machine-learning, deep-learning, research, programming-languages
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_3 on 2016-10-31. Score: 35 | Accepted answer
  
  First, I guess that you mean [Common Lisp](https://en.wikipedia.org/wiki/Common_Lisp) (which is a standard language specification, see its [HyperSpec](http://www.lispworks.com/documentation/HyperSpec/Front/)) with efficient implementations (à la [SBCL](https://sbcl.org/)). But some recent implementations of [Scheme](https://schemers.org/) could also be relevant (with good implementations such as [Bigloo](https://www-sop.inria.fr/mimosa/fp/Bigloo/) or [Chicken/Scheme](https://www.call-cc.org/)). Both Common Lisp and Scheme (and even [Clojure](https://clojure.org/)) are from the same Lisp family. And as a scripting language driving big data or machine learning applications, [Guile](https://www.gnu.org/software/guile/) might [be](http://username_3.net/username_3/guile-tutorial-1.html) a useful replacement to Python and is also a Lisp dialect. BTW, I do recommend reading [SICP](https://mitpress.mit.edu/sites/default/files/sicp/index.html), 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](https://en.wikipedia.org/wiki/TensorFlow) is coded in C++ & Python. [Deep learning libraries](http://machinelearningmastery.com/popular-deep-learning-libraries/) are mostly coded in C++ or Python or C (and sometimes using [OpenCL](https://en.wikipedia.org/wiki/OpenCL) or Cuda for GPU computing parts).
  
  Common Lisp is great for [symbolic artificial intelligence](https://en.wikipedia.org/wiki/Symbolic_artificial_intelligence) because:
  
  * it has very good *implementations* (e.g. [SBCL](http://sbcl.org/), which compiles to machine code every expression given to the [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop))
  * it is [**homoiconic**](https://en.wikipedia.org/wiki/Homoiconicity), so it is easy to deal with programs as data, in particular it is easy to generate [sub-]programs, that is use [meta-programming](https://en.wikipedia.org/wiki/Metaprogramming) techniques.
  * it has a [Read-Eval-Print Loop](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) to ease interactive programming
  * it provides a very powerful [macro](https://en.wikipedia.org/wiki/Macro_%28computer_science%29) 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](https://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29) (even code can be garbage collected)
  * it provides many [container](https://en.wikipedia.org/wiki/Container_%28abstract_data_type%29) 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](https://ai.stackexchange.com/q/35/3335).
  
  Several symbolic AI systems like [Eurisko](https://en.wikipedia.org/wiki/Eurisko) or [CyC](https://en.wikipedia.org/wiki/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](https://en.wikipedia.org/wiki/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](https://en.wikipedia.org/wiki/Bootstrapping_%28compilers%29) 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](http://bootstrappingartificialintelligence.fr/WordPress3/), which has inspired the [RefPerSys](https://refpersys.org/) project.
  
  > **Comments:**
  > **username_4**: I'd like to add here, that tensorflow and theano are based on computational graphs, which is actually symbolic programming, but within imperative language.  
  
  ---
  
  ### Answer by username_1 on 2016-10-31. Score: 18
  
  David Nolen (contributor of [Clojure](https://fr.wikipedia.org/wiki/Clojure) and [ClojureScript](https://github.com/clojure/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](http://blog.samibadawi.com/2013/05/lisp-prolog-and-evolution.html) why the language wasn't able to maintain its initial reputation.
  
  [This](http://norvig.com/paip-preface.html) 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.
  
  
  ---
  
  ### Answer by username_2 on 2017-03-09. Score: 5
  
  ## 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](http://www.fast-downward.org/)
  
  This is probably the best-known classical planning system, which is written in C++ and some parts (pre-processing) in Python.
  
  ### [Fast-Forward](https://fai.cs.uni-saarland.de/hoffmann/ff.html)
  
  Together with Fast-Downward, this is the classical planning system everyone knows. It's written in C.
  
  ### [VHPOP](http://www.tempastic.org/vhpop/)
  
  This is one of the best-known partial-order causal link (POCL) planning systems. It's written in C++.
  
  ### [SHOP and SHOP2](https://www.cs.umd.edu/projects/shop/)
  
  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](http://www.uni-ulm.de/en/in/ki/research/software/panda/panda-planning-system/)
  
  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)](http://www.icaps-conference.org/index.php/Main/Competitions), which take place every two years. The competing planners' codes are published open-source (for a few years).
  
  
  ---
  
  