Is there a best programming language for AI?

Photo by Christina @ on Unsplash

“Anybody who comes to you and says he has a perfect language is either naive or a salesman.”

— Bjarne Stroustrup, the creator of the C++ programming language

There is no such thing as an AI stand-alone application. It is often built with purpose of being integrated into a production system with a front-end, a back-end, an application logic, one or multiple databases or data streams, and a core system with networking and security protocols. If the application logic and data analytics are often built with Python, the rest of the application is based on programming languages like any other application: JavaScript, Java, Objective C, and Swift for the front-end; PHP and ASP.NET for the back-end; and C and C++ for the core system. So the answer to the question in the title of this paper is: there is no one but a stack of programming languages to build an operational AI application.

Like any question on a topic as hot as AI, this one has already triggered answers, corrections, comments, and new questions on the Web. Some developers claim it is Python. Others claim it is a new language just a few heard about (for example, Julia) or an old language that was forgotten (for example, Lisp). And yet others assert there is no one best-fit and that every language can do the job. The goal of this paper is to provide facts to answer this question.

To help speed up development, all the well-established programming languages come with frameworks. While one can choose to write all the code from scratch, considering writing a complete application or system without a framework is really time-consuming. In the rest of document, mentions of languages include libraries and frameworks. For instance, when I mention JavaScript, I include all the libraries, compilers, and frameworks that come with it.

An AI application is like any other application. It has the following modern layered-architecture: a front-end, a web server, an application logic, one or multiple databases/data streams, and an core system accompanied by networking and security protocols. This architecture applies to AI applications as well — whether the latter are for choosing the best places to advertise, finding the best locations for stores, or optimizing a supply-chain:

  • Front-end layer: On the Web, the front-end likely runs JavaScript, the language that rules Web development: about 95% of websites use JavaScript (source: W3Techs surveys). On Android, it probably runs Java, and on iOS, it either runs Objective-C or Swift.
  • Server-side layer: The situation is much clearer when it comes to the web server-side. It is the realm of PHP and ASP.NET with around 78% and 11% of websites followed by Java with 3% of websites (source: W3Techs surveys).
  • Application logic layer: When we descend down the technology stack below the front and web server layers to the application logic layer, the situation is also straightforward: Java and .NET for enterprise business applications, C/C++ for high-performance technical applications, and Python to add machine learning capabilities. With the resurrection of symbolic AI, new probabilistic programming languages are built on top of traditional languages and libraries. The most advanced include Figaro (a super-set of Scala), and Pyro and Edward (both super-sets of Python). These new languages allow the development of many real cases where the quantity and quality of data are insufficient.
  • Data layer: When we go even further down to the data layer, it is the world of data management ruled by SQL, big data ruled by MapReduce frameworks, and statistics ruled by R.
  • Core system layer: At the lowest layer, reign the performance languages C and C++. If the situation has to change, a new entrant could be Google’s Go that the company has developed as a replacement to C++ and Java in its high-scale servers.

To a wannabe developer or non-technical person, the software development ecosystem would seem complex. He or she would likely ask “why so many programming languages?”. There are two reasons that explain the apparent complexity in using a programming language.

First, the genesis, development, adoption, maturation, and decline of programming languages follow the trend of software development. For example, FORTRAN emerged to address simulation purposes, COBOL fitted accounting needs, C was tied to Unix operating system, and so on. As the trend shifts from one need to a new one, new languages appear or old ones resurface. Second, there is the legacy that is in production and continues to grow year after year. This explains why FORTRAN is still alive in science and military centers, and COBOL in commercial banks. If Python is hot today, it is because data science is hot these days as it was for JavaScript with web development and Java before with CRM development.

Although based on previous research, consulting, and implementation work, the views, thoughts, and opinions expressed in this article belong solely to the author, and not to the author’s current or previous clients or employers. The author welcomes comments, please post them here or on LinkedIn.

Hassan Lâasri is a consultant in digital, data, and AI technologies for business transformation. You can reach him at

Data strategy consultant, now leading marketing for Sparkling Logic, Inc.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store