The Programming Language(s) of the Future

The Programming Language(s) of the Future

I have a Quora account and I enjoy reading programming relating questions and answers. I suggest the same to you because you can benefit from the experience of other programmers. Nevertheless, recently, I have seen questions like these:

What is the technology that will replace JavaScript? Does Kotlin have a chance to replace Java? Will Rust replace C++? Which language has the brightest future in replacement of C between D, Go, and Rust? I liked the last one especially because the person who asked the question is so sure that he gives alternative options. I think such type of questions have started to get asked more frequently than before since the academic paper “Energy Efficiency across Programming Languages: How Does Energy, Time, and Memory Relate” is released. (You can read the paper from here if you want.) I think all of these questions lead to one common question we want to learn the answer to: What is the programming language(s) of the future? In this article, by using the results from the given paper, and analyzing other statistical information, we will try to find the answer to this question. Before I start, I guarantee that I will be objective as much as possible, since I don’t want to give you a biased result. Let’s start with the latest phenomenon, the paper.

The Paper If you decided to read further, I’m almost sure that you must have seen the table given below:

1_1qSRIaZijmr46V2vCp74ag.png

I saw this thing too many times. Lots of people shared this on different social media platforms and know there is almost nobody who doesn’t know this table. But, before digging into the results directly, I want to share some preliminary information.

The first important question about these results should be how these results are measured. The generally accepted method to measure the performance of CPUs is benchmark testing. The authors did the same thing for programming languages and they considered 10 different programming problems that are expressed in each of the languages, following the same algorithm, as defined in the Computer Language Benchmark Game. These algorithms and their data sizes are given in the table below:

1_tRrOtAA7MGs9VvfHVAPSVg.png

Also, they categorized programming languages concerning their paradigm which is given in the table below:

1__fzZN5X60jXyasyxSmmlwA.png

Nevertheless, the paradigm is not that important for performance tests. The important is the type of the programming language: is it compiled, interpreted, or used with virtual machines? There is a clear performance and energy usage difference between compiled, virtual machine, and interpreted languages. Thus, they tested these algorithms in their class which is the right thing to do.

The next step is performing the CLBG tests. They shared results for several problems. Let’s take a look at them.

1_juIcJFvEnQSgXhRa-b56qQ.png

The energy is measured in joules and time in seconds. And the ratio is the ratio between energy and time to calculate the approximate power consumption of the language. In addition, there are up and down arrows just next to the languages. The arrow with one line shows how many steps this programming language goes up/down if we order this table concerning the execution time. The double-lined arrow is the same but the order is done with respect to the peak memory usage.

When I saw the first table I shared above on social media, I thought the order with respect to execution time is also important but it wasn’t shared. But they did that case specifically. According to what we learned about the metrics, for instance, for binary tree C, C++ and Rust gave the best results however from a memory perspective, Rust showed a little poorer performance. On the other hand, the same is applicable for C in the fannkuch-redux benchmark game. There is no clear difference.

1_R5UA3tIPEGwkx4h6wiU6WQ.png

On the other hand, the fasta benchmark game shows us a very different table. The performance is getting blurry and blurry. But these are case specific, so we can analyze other results.

The one thing I loved about this paper is that they also compared the languages concerning the class type they belong to, so you can compare compiled and interpreted languages inside their class. The results of these 3 tests are given below.

1_DPVH7M-vgQSG9f8hiKgDPg.png

I don’t want to give you more data related to this paper. If you're going to check, you have the link for it and you can read further. However, in the end, we reach the result table given below, which was shared above:

1_ZwtqQL4ZVgO0L1FGUyr3mg.png

In the end, the C language seems the best for energy and performance except for memory. But in memory, it’s not bad as well. Rust and C++ are the following. So we can say that C or Rust will be the best cho… Wait a minute! These languages don’t support object-oriented programming. (You can think Rust supports it but it only supports interfaces (or traits in Rust language), not the OOP structure). However, in companies, generally, we’re using OOP companies and also the ease of use is important. C, C++, and Rust are not that easy, they force you to think about object lifetimes, dynamic allocations, etc. Thus, we should think about these categories as well. But even just in 3 categories, there are lots of differences and blurry decisions. If we consider the ease of use, and power of the implemented structures, the results will get more blurry.

Until now, what have we learned? We compared the languages concerning their energy consumption, memory requirements, and required time to complete the process. Nevertheless, we cannot decide which language is the best by only checking these metrics. However, if we add more metrics, the results will get too complicated to decide on a language or one language in each type.

On this point, I want to suggest a strategy change: Let’s assume that people are very logical. In economical papers, generally, researchers assume this although humans are not that logical. However, let’s assume that we’re very logical and picky. Then, how can we decide on the best language? By analyzing the trend of which programming languages are used the most. How can we measure that? There is a lot of code written in cyberspace and most of them are being held in private repositories. Could we check the search engine statistics since we know all developers use search engines when they face a problem with their software? Let’s move on with that.

Google Statistics The Google trend tools are open to everybody. I used this tool to get google search statistics about programming language but there is a limit: You can get only data from the 5 keywords. So, let’s start with the best 3 languages according to previous results and Java.

1_zdwrZKJEO1nNpgjzWtevpQ.png

It seems that Java is still used more than other compiled languages although it decreased significantly. C and C++ are very close to each other. However, Rust is very low. It might be because it’s a new language but to be fair, Rust is new with respect to C and C++. However, it’s released in July 2010. Almost 12 years passed and since then, there is no significant change. The result of these statistics is very different than the results we got previously. Let’s continue with Java and by choosing 4 different languages: Kotlin, Javascript, Python and Go.

1_wheK-3OEcl8JNEmE-x0Vmg.png

The table changed again and there is a very different trend now. Python started low but it’s the highest demanding language now. Java and JavaScript are in the second. Python is the leader now, but I want to give one more round.

1_C9spxf171Llg2UJYWU9BGQ.png

Okay, it seems we have a winner: Python! Nevertheless, we should be objective as much as possible and we analyzed the statistics of just one search engine. It’s one of the world's most common search engines but the results may change. However, we cannot do this search one by one and combine them since it will take too much time. The good thing is that there is a company which is doing this for us.

TIOBE Index TIOBE is a company specializing in assessing and tracking the quality of software. You can check their website to learn more about them. Their main service offer is checking the software codebase quality. They created an indicator called TQI (TIOBE Quality Indicator), and an example of this indicator is given below.

0_pACR8Om4BYrfvxXx.png

This company created a programming language index called the TIOBE index. By using this index, they are measuring the performance of programming languages based on search engine trends and they’re considering almost all related search engines. You can read further about how the TIOBE index is measured here.

Based on this index, the latest results are given below:

1_287hY2KELajpiAnGRfWjng.png

It’s very close to the results we saw in Google trends. However, in here C is the second most common language which was unexpected. Also, there is a historical graph of the performances of programming languages like this:

1_WNYW7RoGufBRTFeg5SFjIw.png

It’s clear that Java dominated the environment for a long time with C. However, Python has gotten popular and popular and became the first now. There is a critical point that should be noticed here: Trends are changing constantly. Java was the first, but now it’s python although it was very low before 2010. Thus, the question is, how can we measure the future potential of programming languages?

Considering Future Possibilities For the last 10 years, machine learning and artificial intelligence became very popular. The Python language was the best choice for such numerical operations because there is a good C API and when you need performance, you can combine the language with C and C++. In this trend, Python became the most used language in the world according to search trends and indexes.

However, this doesn’t mean that Python will preserve its place. Some other languages may show better performance than Python and displace it. For instance, consider Rust. Amazon and Facebook declared that they started using Rust to develop their internal CLI (command-line interface) tools. Also, the Linux kernel after version 6.1 contains Rust. It’s very strong support for a programming language and as you can see, it had risen from 26th to 20th in 1 year.

The question is still not answered. How could we predict the future?

The Answer I’m so sorry to make you read all of these things but this question is meaningless. We’re not politicians, nobody gives us a budget or money or anything that has a good value to support these technological trends (if you’re earning such a value, definitely continue doing it, I don’t want to prevent you from making money).

Then, why are we doing this? We’re supporting a language or a technology fanatically? The general answer is that because we are lazy. We’re learning a programming language or a technology, then developing a comfort zone around these tools. Then, we don’t want to change them to stay inside our comfort zone. The people who support C and C++ too much fanatically are doing this because they don’t want to learn a new language like Rust from scratch. The people who support Rust too much fanatically, because they don’t want to learn C and C++ since they are a little hard and there are lots of things to be careful about. I think both of these approaches are mistaken and wrong and we shouldn’t do this mistake. In my opinion, we should be better than this.

0_4iNHgqRP4oN9ihAJ.png

Programming languages are just tools like screwdrivers. If you need to use a fillister head screwdriver, you won’t force to use a flat-tip screwdriver. You will decide according to the circumstances you have. If you have the ability to decide the type of screw, then you will consider the structure of the wall or the material you will use. You might use tape or something else depending on your situation. An engineer should think about the optimal solution according to the requirements.

In brief, there is no ultimate programming language that replaces everything else. There are only the requirements in your current position, and you should use the correct tool. That’s it, nothing more, and to achieve that, you should know the specific features of the programming languages you’re considering.

Because of my focus area, I’m generally using C, C++, Rust, and Python. I don’t have enough experience to talk about other languages but I can give you an example analysis of the pros and cons of the languages I’m using. I wrote another article about this, which is given below:

I hope you enjoyed it. Thank you for your time and kind regards. Umesh Tharuka Malaviarachchi