"Which Programming Languages Use the Least Electricity?"
Sounds like a silly question, but makes for a rather intriguing read!
@fribbledom i think it's a glorious question, we're killing the planeto
that was definitely an interesting read!
One thing though that might also make an impact, is how easy it is to use/write code in.
I can imagine that if a language takes a longer time to solve a problem in, you'd also use more energy just from having your computer on while writing it.
Interpreted languages rather than compiled languages are likely to have an advantage here.
@FiXato @fribbledom along these lines, one has to consider that Erlang has many functionalities that in other languages would require third party systems (message queue, distributed database, service discovery and others). Therefore, to be fair, we’d need to consider those as well for each language.
@fribbledom As dumb as it sounds, wouldn't it be natural, that the language, that for any given operation, has the smallest RAM IO delta is the most energy efficient? Of course there will be critical points, where one would have to go into linear optimization, but assuming the same runtime in a non critical situation, there would be less energy cost if a program reserved 100MB of ram, but nearly didn't write anything to it, ...
@fribbledom compared to a program that only reserved 10MB but in exchange IOed like 200MB in and out of ram. So for example if PHP had statically already loaded an efficient regular expression routine, where C/C++ first would have to initialize an object of the same nature, PHP would naturally consume less energy with keeping pre-allocated DRAM cells versus C having to write an object or even a hierarch of objects to RAM for one use, before relequishing the allocated cells again. ...
@fribbledom At least to me the article mostly implies, that the least amount of abstraction on average is more efficient. I'm not commenting here on switching of transistors or fets, because i couldn't find any specifics about those, so I was only looking at the most obvious offender, in this case DRAM.
@fribbledom they didn't even mention compilation time resource usage which I would hope they would do
and also those microbenchmarks are not very representative for real world imo but for computatutions it seems to be close to truth
@fribbledom ah, i wish they'd examined D... i guess it's still too obscure =(
@fribbledom I wonder how compiled Lisp would fare, since it gets translated into C (or C++, I can't remember) and I'm curious about how efficient the translators are.
@fribbledom I would assume microcode. 🤔
One thing that was not looked over(but I guess it is rather hard to do so) , is the energy needed to write a program. As a general assumption, I would guess writing something in a interpreted language is faster and thus more energy efficient than writing a compiled one.
I'm not sure if that's really an oversight or rather quite intentional.
For any program where energy consumption actually matters, the development time most likely makes up for the tiniest fraction of their consumption. After all we're talking about processes that get deployed not only on hundreds or thousands of machines, but literally millions of devices.
That's what it though at first but after thinking about some real open-source project where the code has to be maintained, review, accepted or rejected and rewrite by numerous people, I started doubting it was neglectable
Server run by the main developers of the project It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!