15 programming languages for artificial intelligence (AI)

programing languages

Programming languages have played a significant role in the evolution of artificial intelligence (AI) since the late 1950s. They are the main tools for building computer programs that simulate intelligent processes like planning, learning, reasoning, problem-solving, perception, manipulation, etc.

The primary use of computers in the early days was to perform calculations with numbers. However, researchers soon found that one of the special requirements for AI is to easily manipulate symbols and lists of symbols rather than processing numbers or strings of characters. This led to the notion of symbolic computation as a suitable means of defining algorithms that processed information of any type and could be used to simulate human intelligence.

It soon turned out that programming with symbols required a higher level of abstraction than was possible with those programming languages that were specifically designed for processing numbers.

Since the languages of the time did not offer such facilities, a researcher from MIT, John MacCarthy, developed, during 1956-58, the definition of an ad-hoc language for logic programming, called LISP (LISt Processing language). Since then, several hundred derivative languages, so-called “Lisp dialects,” have emerged. Because of its expressiveness and flexibility, LISP was very successful in the artificial intelligence community until the 1990s.

Another important event at the beginning of AI was creating a language with the main purpose of expressing logic rules and axioms. Around 1972 a new language was created by Alain Colmerauer and Philippe Roussel named Prolog (PROgramming in Logic), in which the expected logical rules of a solution can be defined, and the compiler automatically transforms it into a sequence of instructions.

Prolog is used in AI and natural language processing. Its rules of syntax and its semantics are simple and considered accessible to non-programmers. One of the objectives was to provide a tool for linguistics that was compatible with computer science.

In the 1990s, the machine languages with C / C ++ and Fortran gained popularity and eclipsed the use of LISP and Prolog. Greater emphasis was placed on creating functions and libraries for scientific computation on these platforms and were used for intensive data analysis tasks or artificial intelligence with early robots.

In the middle of the 1990s, Sun Microsystems started a project to create a language that solved security flaws, distributed programming, and multi-threading of C++. Besides, they wanted a platform that could be ported to any type of device or platform. In 1995, they presented Java, which took the concept of object orientation much further than C++.

One of the most important additions to Java was the Java VM (JVM), which enabled the capability of running the same code in any device regardless of their internal technology and without the need of pre-compiling for every platform. Java offered one of the first frameworks, with specific tools for the internet, bringing the possibility of running applications in the form of java applets and java scripts (i.e., self-executing programs) without the need of installation. This had an enormous impact on AI and set the foundation in the fields of web 2.0/3.0 and the internet of things (IoT).

However, the development of AI using purely procedural languages was costly, time-consuming, and error-prone. Consequently, this turned the attention into other multi paradigm languages that could combine features from functional and procedural object-oriented languages.

Although first published in 1991, Python started to gain popularity as an alternative to C/C++ with Python 2.2 by 2001. The Python concept was to have a language that could be as powerful as C/C++ but also expressive and pragmatic for executing “scripts” like Shell Script. In 2008, the publication of Python 3.0 solved several initial flaws. Later, the language started to be considered a serious contender for C++, Java and other scripting languages such as Perl.

Since 2008, the Python community has been trying to catch up with specific languages for scientific computing, such as Matlab and R. Due to its versatility, Python is now used frequently for research in AI. However, although Python has some of the advantages of functional programming, run-time speeds are still far behind other functional languages, such as Lisp or Haskell, and even more so from C/C++. Besides, it lacks efficiency when managing large amounts of memory and highly-concurrent systems.

From 2010 and mostly driven by the necessity of translating AI into commercial products, that could be used by thousands of users in real-time, IT companies looked for alternatives by creating hybrid languages, that combined the best from all paradigms without compromising speed, capacity, and concurrency.

In recent years, they used new languages such as Scala and Go (Google), as well as Erlang (Facebook) or Clojure, for applications with very high concurrency and parallelization, mostly on the server-side. New languages such as Julia and Lua have also emerged for scientific computation.

In this post, we will have a quick look at the list of top programming languages used in AI history.

1. Lisp

Year: 1958
Type: Multi-paradigm (functional, procedural)
Influenced by: IPL

  • The second oldest programming language.
  • Homoiconic: easy to deal with a large amount of data.
  • Good mathematical alignment.
  • Lots of resources for symbolic AI (Eurisko or CYC)
  • Rapid prototyping, dynamic object creation, garbage collection and flexibility

2. Python

Year: 1972
Type: Procedural
Influenced by: C++, Java, Haskell, Perl

  • Highly useful standard library that makes the language versatile and flexible. Focus on rapid development.
  • Plethora of frameworks and utilities for AI, ML, deep learning, scientific computing, natural processing language, etc.
  • Some of its most popular libraries include TensorFlow, scikit-learn, PyTorch, Keras, SparkMLlib, MXNet, Theano, and Pybrain.
  • Excellent community support

3. R

Year: 1972
Type: Declarative
Influenced by: Lisp, Scheme

  • Most comprehensive sets of statistical analysis functions and packages.
  • Rich community of tools for AI or ML provided freely through the CRAN repository.
  • AI programming packages include Gmodels, Tm, RODBC, and OneR.
  • Active and supportive community
  • Wide variety of libraries and packages

4. C++

Year: 1983
Type: Procedural
Influenced by: C, Algol 68

  • Fast execution times.
  • Some compatible libraries for AI, such as Alchemy for Markov logic and Mlpack for general ML.

5. Prolog

Year: 1984
Type: (procedural, functional)
Influenced by: Planner

  • Good set of utilities for expressing the relationships between objects and symbolic computation.
  • Large set of internal functionalities to perform logic programming.
  • Prolog offers two approaches – symbolic approach (rule-based expert systems, theorem provers, constraint-based approaches) and statistical approach (neural nets, data mining, machine learning)

6. Erlang

Year: 1986
Type: Functional Concurrent
Influenced by: Lisp, Prolog

  • Good framework to deal with concurrency and elastic clouds (scalability).
  • Libraries for logic programming such as erlog

7. Go

Year: 1990
Type: Functional
Influenced by: Algo, CSP, Python

  • Easy concurrency and asynchronous patterns with a decent run-time.
  • A few libraries for machine learning, such as Golearn.

8. Haskell

Year: 1990
Type: Functional
Influenced by: Lisp

  • Easy parallelization and possibility of handling infinite computations.
  • A few utilities to implement neural networks (LambdaNet) and general ML (HLearn).
  • Strong abstraction capabilities
  • Built-in memory management
  • Code reusability and easy to understand

9. Matlab

Year: 1993
Type: Multi-paradigm
Influenced by: APL

  • Solid Integrated environment. Matrix, linear algebra oriented language.
  • A selection of toolboxes and utilities for machine learning, statistics, and signal processing.

10. Lua

Year: 1993
Type: (procedural, functional)
Influenced by: C++, Scheme

  • Versatile and lightweight language.
  • It is the de-facto language used for the machine and deep learning framework Torch.

11. Scala

Year: 1993
Type: Multiparadigm (procedural, functional)
Influenced by: Erlan, Haskel, Java, Lisp, Lisp (Scheme)

  • Fast run time (almost as C). It runs on top of the JVM. Very good support for distributed systems.
  • Several libraries and frameworks for AI, ML, and numerical computing (ScalaNLP).

12. Java

Year: 1995
Type: Procedural Concurrent
Influenced by: C++, Ada 83

  • VM provides efficient maintainability, portability, and transparency.
  • A myriad of libraries and tools for AI such as Tweety and ML (DeepLearning4, Weka, Mallet, etc.)
  • User-friendly, flexible, and platform-independent.

13. C#

Year: 2000
Type: Multi-paradigm (functional, procedural)
Influenced by: C++, Java, Haskel

  • Easy prototyping and well-elaborated environment.
  • Most used language for AI in games as it provides excellent compatibility with popular games engines such as Unity.

14. Clojure

Year: 2007
Type: Functional
Influenced by: Lisp, Erlang, Prolog

  • Easy design and cloud infrastructure that works on top of the JVM.
  • Rapid interactive development and libraries for development of behavior trees (alter-ego)
  • Software transactional memory (STM), persistent immutable data structures and interactive programming

15. Julia

Year: 2012
Type: Multi-paradigm
Influenced by: Lisp, Lua, Matlab, Python

  • Easy integration with C and Fortran. Scientific oriented language.
  • Several ML packages such as Mocha, or MLBase.
  • It is fast, has a math-friendly syntax, and automatic memory management
  • Superior parallelism.
  • Dynamic type system and built-in package manager
  • Direct support for C functions