Exploring AI Programming Languages: AIML, Lisp, C++, and Python

In summary, Python is a popular language for AI development due to its wide variety of available libraries. However, its lack of formal standardization and potential performance issues make it a controversial choice for long-term projects. Other languages like C++, C#, and Java may offer more robust and standardized options for AI development.
  • #1
Oscar Flick
I found an article about AI programming languages (https://qubit-labs.com/ai-programming-languages-choose/) and I've got several questions:
1. Are AIML and Lisp still used in programming?
2. Several sources refer to C++ as the fastest programming language? In what way the speed of language is measured?
3. Is Python really best for AI development?
 
Technology news on Phys.org
  • #2
Oscar Flick said:
I found an article about AI programming languages (https://qubit-labs.com/ai-programming-languages-choose/) and I've got several questions:
1. Are AIML and Lisp still used in programming?
2. Several sources refer to C++ as the fastest programming language? In what way the speed of language is measured?
3. Is Python really best for AI development?
1) I have never seen any use of AIML or Lisp outside of the education sector. I'm sure there has been some - but it's rare. Also, if you look at job listings, it's been a while since I seen anyone asking for Lisp.
2) The speed would be measured in the amount of processor time required to execute an algorithm. If C and C++ are the fastest (and they would certainly by among the fastest), it is because it has several things going for it. First, it is a very flexible and relatively low-level language. So the implementation of the algorithm can be done with very effective concern for execution time. Second, it is a very widely used language, there are many implementations on the compiler, and many people working on making the compiler better. Which leads to the third item, the optimizing features of C/C++ are implementation-dependent, but the most used implementations have really, really excellent optimization features. And when new computer processor features become available, it's the C/C++ compilers that are usually the first to take advantage of them.
3) "AI development" includes a broad category of applications. Certainly in the academic arena, Python allows you to skip a lot of details that you would need your attention with a language like C or C++. It would depend on the curriculum and the course objectives.
 
  • Like
Likes lomidrevo
  • #3
Alternatively, you can use a good development language like MATLAB to design AI algorithms (neural networks, fuzzy logic, computer vision, optimization, etc.) and auto-generate code in a fast language like C++. That gives you the combination of a good development environment and fast-running production code.
 
  • Like
Likes Wrichik Basu and atyy
  • #4
AI algorithms can be quite demanding of execution speed, especially if they are used in "hard" real-time applications. Python can be slow -- sometimes painfully so. The applications that I have seen are real-world, real-time programs. They have been developed in MATLAB and then C or C++ code was auto-generated to get fast running performance. Some of the auto-generated code still had to be modified by hand to get the required speed.
 
  • #5
Oscar Flick said:
Is Python really best for AI development?
Python is very popular language these days, so it is not surprising that many AI platforms have been developed respecting that. It is not the syntax of python what makes it a good choice for machine learning projects, but the variety of libraries that are available for python. Although, those libraries are designed to be used with python, it doesn't mean there are written in python. Actually many of them are written in highly-optimized languages like C or C++.
 
  • #6
I know how popular Python is these days, but my belief (based on a lot of experience) is that in the long haul, you'd be better served using a robust and standardized programming language such as C# or even Java. C# in its current generations has AI list-processing and other advanced features in it, and it has a world-class IDE; the language is standardized, the IDE is free, and it has high performance. Pretty much the same holds for Java, except there you need Scala and other add-ons, and it is not quite as high performance. Also tougher to use on websites.

My main beef about Python is that, like Perl, and Ruby, it is not formally standardized by an external body, and instead has a de-facto standard: pretty much whatever the original working implementation does. This means that not all tools for Python will be identical, and there can be compatibility issues going forwards.

Also, for scientific programming, sooner or later the lack of type declarations (so-called "duck" typing) can bite one in the butt, when the language finally makes a wrong guess on the type of a variable, usually after the programmer (typically in a large, stringy program) forgets its type and uses it as a different type. These kinds of bugs can be very difficult to track down in a large program.

Lisp is certainly still usable but I personally cannot recommend it because so few people will be able to work with the code, compatibility issues, performance issues, all of it. But Python's beauty is how quickly beginners can get started programming without having to learn anything about internals. That is good but will only carry you so far in the programming world.

These views are 100% guaranteed to be controverial.
 
  • #7
I don't doubt some programmers are using Python for AI programming, but keep a couple of factors in mind (one mentioned above already):

* Python is probably not the highest performing language, and AI models are going to be serious CPU hogs.
* Python is not formally standardized by an external body. Why does this matter? After another few years, the code may break when upgrades in Python occur.

Take PHP and Ruby as an object lesson on the standardization. Both are wildly popular, and code written in them WILL be forced to upgrade as old versions become obsolete, and things DO break when that happens. I can't say personally how much this has happened in Python, although it happened in the early versions of Python that I used.

Also--people constantly mention that Python has "easier syntax" than other languages. I can't believe that anyone who has been programming for more than 3 months considers that a real reason to choose Python. The fact is, programmers get attached to the languages they learn in (and Python is being widely taught in classes these days), but please stop already with the syntax claims (Ruby enthusiasts did the same) or the claims that Python somehow has better libraries that other languages these days. They are all good.

With something big cost and performance intensive as AI, you want performance and standardization above all. That gives you several options. Python IMO should probably not be one of them, at least not as the main portion of a project.
 
Last edited:
  • #8
harborsparrow said:
I can't say personally how much this has happened in Python
Twice: the changes from Python 1 to Python 2, and from Python 2 to Python 3. Over the 32 years since the first Python release, that's pretty good.
 
  • #9
I guess that I'm a knucklehead. I'm curious as to what language you think that people are using in AI development these days if not python. I haven't met them.
harborsparrow said:
Python is probably not the highest performing language, and AI models are going to be serious CPU hogs.
Any serious AI model training will use GPUs which python typically interfaces with through libraries like CUDA in C++ or cuDNN.
PeterDonis said:
Twice: the changes from Python 1 to Python 2, and from Python 2 to Python 3. Over the 32 years since the first Python release, that's pretty good.
Which is far better than the breakage that I get when dealing with CUDA changes that are often affected by Microsoft C++ changes under the hood.
 
  • Like
Likes PeterDonis
  • #10
Ha ha Borg. Good point, I replaced the word "knucklehead" with "programmer" (he he). Not saying Python isn't a respectable language for most purposes. However, I think every major language platform can now interface with GPU's; there are some good discussions about how to do it with C# in Reddit, for example (C# being the language I used most before I retired). I also would not recommend C++ because, even though theoretically it's sort of standardized, it operates too close to the metal in most OS's to be safe from version and hardware changes, and it's such a big, messy mish-mash that only C++ deep experts can really deal with it well.
 
  • #11
I'm still wondering what you would recommend. I've been working with AI/ML since 2018. When I started, I asked around about what language I would need to learn. I was overwhelmingly told that most people use python in Anaconda (typically Jupyter Notebooks). I've seen references to implementations in other languages (even Java) but the vast majority of the implementations online and everything in my professional environment is in python.
 
  • Like
Likes PeterDonis
  • #12
I have not been active in this field (or as a programmer recently), so your experience exceeds mine in the particulars. C# is probably good enough in every technical aspect, but its performance has been optimized particularly for Windows platforms, and that might rule it out. Java is not standardized either, nor is it (the last I knew) adequately high performance. If it came down to Python vs. C++, I would pick Python.

My feeling is that AI LLM's are so new that the programmers engaged in creating them have not been at it long enough to experience the upgrade pains that will likely come their way.
 
  • #13
harborsparrow said:
My feeling is that AI LLM's are so new that the programmers engaged in creating them have not been at it long enough to experience the upgrade pains that will likely come their way.
They are certainly newer than Python 3, which came out in 2008 and became viable (with Python 3.3) in 2012.

The Python dev team does not appear to have any plans for a Python 4 any time soon, quite possibly because they are gun shy about such changes after the pain of the Python 2 to Python 3 transition (which was a huge pain in large part because of how it was bungled by the dev team). One downside to that is that it has taken far longer than it should have for the Python dev team to consider eliminating the Global Interpreter Lock (GIL), which now finally appears to be in the works. That change will be a significant improvement for multi-threaded Python programs.
 
  • Like
Likes Borg
  • #14
Sadly, it seems to take a lot of money/time/resources to seek ECMA standardization for a language, and it takes money to set up an organization to certify compliance with the standard once it is in place. Microsoft had that money and resolve, both for C# and its underlying VM. But many other languages are managed in a leaner financial situation. I feel that the merits of standardization are underappreciated, largely because at any point in time, the bulk of programmers are young, and the benefits of language standardization are only seen after years, maybe even decades, of experience. PHP is a horrible, horrible example of the pain caused by a non-standardized language. It is still heavily in use for MediaWiki (which drives Wikipedia) and every version upgrade breaks things left and right and introduces session and performance issues and is just generally a major pain in the butt--and they MAKE you upgrade by withdrawing support for older versions.

So maybe it can't be avoided, but if you participate and have any involvement with Python language development, do urge them to consider whether it might become standardized in the future. Given it's popularity, if it could overcome that drawback, it could just rule for decades.
 
Last edited:
  • #15
Oscar Flick said:
I found an article about AI programming languages (https://qubit-labs.com/ai-programming-languages-choose/) and I've got several questions:
1. Are AIML and Lisp still used in programming?
2. Several sources refer to C++ as the fastest programming language? In what way the speed of language is measured?
3. Is Python really best for AI development?
Python is wonderful for working with APIs and doing some light/medium ML work since the module support is top-notch. Anything production-worthy likely won't be Python-backed due to Python's general lack of performance when milliseconds matter.
 
Last edited:
  • #16
Since I made the comments in post #3 & #4, I have seen some AI tutorials that were done in Python using AI libraries that worked perfectly well. If I were going to chose now, I would certainly chose Python. There are very good tutorials and a large group of active Python programmers that can be very helpful. I would still hesitate to use Python if there was some intensive computation to be done in that language because I have never seen a benchmark that did not score it as very slow. Maybe things have changed in that regard.
 
Last edited:
  • #17
Of course, Python or any language is fine for a tutorial, and it might "work perfectly well". And if the AI LLM you want to build is for use by only a few people simultaneously and you don't need to worry about performance, fine. But if it's for something like Google Bard that has a gazillion simultaneous users, it's likely not going to measure up.
 
  • Like
Likes FactChecker and Greg Bernhardt
  • #18
harborsparrow said:
But if it's for something like Google Bard that has a gazillion simultaneous users, it's likely not going to measure up.
I might be wrong, but I doubt that a person asking what language to use in this forum is writing an AI program with a gazillion simultaneous users.
 
  • Haha
  • Like
Likes harborsparrow, Vanadium 50 and Greg Bernhardt
  • #19
harborsparrow said:
Of course, Python or any language is fine for a tutorial, and it might "work perfectly well". .
By "perfectly well", I mean that vision recognition programs could identify objects and multiple famous politicians in a real time video. I was impressed. One example was this tutorial of AI on a Jetson Nano. Individuals will need to judge its performance with respect to their targeted application.
1702589386596.png
 
  • #20
A much simpler introduction to vision recognition on a Jetson Nano using Python is here:
 
  • Like
Likes Khi Choy Xichdu and Borg
  • #21
Lol at the Google Bard performance joke.

That said, as someone who worked in industry writing software for decades and also taught programmers in college for ten years, it is usually a mistake to ignore possible future performance constraints, because if you don't design for them out front, you probably can't build good performance later. So in my opinion, it's always good to think about a software design as though it might have to do high performance someday.
 
  • Like
Likes Khi Choy Xichdu, Svein and Mark44

1. What is AI programming language?

AI programming language is a specialized computer programming language designed for creating artificial intelligence algorithms and applications. It allows developers to write code that enables machines to think and behave like humans, making decisions, and solving problems.

2. What are some popular AI programming languages?

Some popular AI programming languages include AIML, Lisp, C++, and Python. Each of these languages has its own strengths and weaknesses, and they are often used in combination with each other to create complex AI systems.

3. What is AIML?

AIML (Artificial Intelligence Markup Language) is a language specifically designed for creating chatbots and virtual assistants. It uses a set of rules and patterns to understand and respond to user input, making it a popular choice for creating conversational AI applications.

4. Why is Lisp considered a good language for AI programming?

Lisp is a functional programming language that is well-suited for AI programming due to its flexibility and powerful list manipulation capabilities. It also has built-in support for creating and manipulating symbolic expressions, which are essential for many AI algorithms.

5. Is Python a good language for AI programming?

Yes, Python is a popular and widely used language for AI programming. It has a simple and easy-to-learn syntax, a large community of developers and libraries, and is versatile enough to handle a wide range of AI tasks, from natural language processing to machine learning.

Similar threads

  • Programming and Computer Science
Replies
8
Views
879
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
15
Views
2K
  • Programming and Computer Science
4
Replies
122
Views
13K
Replies
10
Views
2K
  • Computing and Technology
Replies
2
Views
641
  • Sticky
  • Programming and Computer Science
Replies
13
Views
4K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
29
Views
3K
Back
Top