Datascience Learning Center

Share this post

What are the Greenest Programing Languages?๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ’ป

datasciencelearningcenter.substack.com
Programming

What are the Greenest Programing Languages?๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ’ป

The Answers may surprise you.

Michael Spencer
Aug 29, 2022
6
Share this post

What are the Greenest Programing Languages?๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ’ป

datasciencelearningcenter.substack.com

Hey Guys,

Itโ€™s been a while since Iโ€™ve seen this topic covered. As a fan of both ESG and Green Technology and programming languages I was curious. So I looked it up.

Tl;dr here are the results:

I somewhat suspected C and Rust would be near the top here. This is based on a 2021, the original study was in 2017.

Top Green Programming Languages

  1. C

  2. Rust

  3. Java

  4. Swift

  5. Haskell

  6. C#

  7. Go

  8. Dart

  9. JavaScript

  10. TypeScript

โ€œ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.โ€

This study implemented 10 benchmark problems in 27 different programming languages and measure execution time, energy consumption, and peak memory use.

๐—– ๐—ถ๐˜€ ๐˜๐—ต๐—ฒ ๐—บ๐—ผ๐˜€๐˜ ๐—ฒ๐—ณ๐—ณ๐—ถ๐—ฐ๐—ถ๐—ฒ๐—ป๐˜ ๐—ฝ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ด ๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ, ๐˜„๐—ต๐—ถ๐—น๐—ฒ ๐—ฃ๐˜†๐˜๐—ต๐—ผ๐—ป ๐—ฎ๐—ป๐—ฑ ๐—ฃ๐—ฒ๐—ฟ๐—น ๐—ฎ๐—ฟ๐—ฒ ๐˜๐—ต๐—ฒ ๐—น๐—ฒ๐—ฎ๐˜€๐˜ ๐—ฒ๐—ป๐˜ƒ๐—ถ๐—ฟ๐—ผ๐—ป๐—บ๐—ฒ๐—ป๐˜๐—ฎ๐—น ๐—ณ๐—ฟ๐—ถ๐—ฒ๐—ป๐—ฑ๐—น๐˜† ๐—ฝ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ด ๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ๐˜€.

Full text: https://medium.com/codex/what-are-the-greenest-programming-languages-e738774b1957.

The original report with updated info: https://sites.google.com/view/energy-efficiency-languages/.

Post credit: I saw it on Dr. Milan Milanoviฤ‡โ€™s account.

Datascience Learning Center is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.

Read the PDF Paper

green grass fields
Photo by Bence Balla-Schottner on Unsplash

๐ŸŒ A very common misconception when analyzing energy consumption in software is that it will behave in the same way execution time does. In other words, reducing the execution time of a program would bring about the same amount of energy reduction. However power doesnโ€™t follow this rule.

The Computer Language Benchmarks Game

The CLBG initiative includes a framework for running, testing and comparing implemented coherent solutions for a set of well-known, diverse programming problems.

You can see the complete results here.

I think in some ways the paper is very theoretical and novel and may not fully be totally representative of the challenge of the question, but is pretty amusing at least. I wonder a few years later if this would have changed using the same methodology. As new languages are rolled out like Carbon I wonder if they take this into consideration:

In Case you Missed It

Datascience Learning Center
Google Carbon Wants to be the Successor of C++
August 6th, 2022 8:00 PM MONTREAL, CANADA. I have a summer discount going to reward my early backers and most passionate readers. Iโ€™m really grateful for the support. Who actually reads on the weekend anyways? Hey Guys, At the end of July, 222 as you know, Google announced its new software programming language Carbon. The headlines were about howโ€ฆ
Read more
7 months ago ยท 3 likes ยท Michael Spencer

The study is now about five years old:

The paper was popularized by the Rust people from AWS, and many software engineers donโ€™t take it entirely seriously. However itโ€™s highly shareable and stirs up some useful debate.

You can read a 2021 update to this question here.

There are many variables the study did not take into account according to commentators:

  • Skill of the engineers themselves.

  • Debugging energy

  • Lifecycle energy cost

  • Impact of JIT compilers of many languages

Still the article is a rare example of asking an important and tough question and trying to find the most relevant benchmarks.

Join 33 other paying subscribers for additional content and locked archive posts.

Loading...

Share this post

What are the Greenest Programing Languages?๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ’ป

datasciencelearningcenter.substack.com
Comments
TopNewCommunity

No posts

Ready for more?

ยฉ 2023 Michael Spencer
Privacy โˆ™ Terms โˆ™ Collection notice
Start WritingGet the app
Substackย is the home for great writing