Connect with us


What Are the Greenest Programming Languages?

Learning a programming language and becoming an expert in that language is not easy. Although most developers know several programming languages, we only consider ourselves experts in one or two.

When deciding on a new programming language, we usually take into account things like its syntax, its learning curve, its documentation, or whether it is widely used or not.

But have we ever wondered which programming language is more sustainable and consumes less energy?

This is not a fact that we are used to considering when choosing between JavaScript, Python, Java, C#, or any other language.

However, a few years ago, some Portuguese researchers set out to investigate the energy consumption of up to 27 of today’s most popular programming languages, subsequently presenting their research at the International Conference on Software Language Engineering 2017.

These results are still valid in 2021 because they were updated this same year.

Energy Efficiency across Programming Languages

Abstract of the paper:

This paper presents a study of the runtime, memory usage, and energy consumption of twenty-seven well-known software languages. We monitor the performance of such languages using ten different programming problems, expressed in each of the languages. Our results show interesting findings, such as slower/faster languages consuming less/more energy, and how memory usage influences energy consumption. We show how to use our results to provide software engineers support to decide which language to use when energy efficiency is a concern.

According to the “paper,” in this study, they monitored the performance of these languages using different programming problems for which they used different algorithms compiled by the “Computer Language Benchmarks Game” project, dedicated to implementing algorithms in different languages.

The team used Intel’s Running Average Power Limit (RAPL) tool to measure power consumption, which can provide very accurate power consumption estimates.

The research shows that several factors influence energy consumption, as expected. The speed at which they are executed in the energy consumption is usually decisive, but not always the one that runs the fastest is the one that consumes the least energy as other factors enter into the power consumption equation besides speed, as the memory usage.


In this ranking, we can see the “greenest” and most efficient languages are: C, C+, Rust, and Java, although this last one shoots the memory usage.

View at