Live data from Hacker News

Which Programming Languages Use the Least Electricity? (2018)

thenewstack.io

41–50 of 267 posts

Re: Which Programming Languages Use the Least Electricity? (2018)

#41

Not sure what to make of this research. It's not like I can switch out JS in favor of these other languages (many of which are compiled binaries) in my web apps. The performance of for example web servers written in the different languages entirely would seem more interesting to compare. The JS/TS comparison was directly fishy. I found no mention in the paper of how they managed to "run" the tasks in Typescript, whic…

Just use it as another ballpark reference of what trade-offs are being made when going with one language or another. Not really any different than any other language benchmark/shootout comparison.

Unless you have very large numbers of [users|servers|whatever] to amortize the cost of going one way vs another over, it's probably not worth even considering trying to change anything on your end. More likely, your personal or team productivity is the much more important metric to optimize for anyways. If you're doing things at FAANG scale, it's an entirely different story.

Re: Which Programming Languages Use the Least Electricity? (2018)

#42
post #34
post #22

Earlier quoted context omitted.

> you’re using that assumption to cast slippery-slope doubt on the whole project without knowing anything specific. No! I think this is a very useful project and analysis. I just think that some languages might have extremely optimized versions (or possibly more likely, some languages don't quite yet have that extremely optimized version that has propagated throughout the others) and that might be affecting specific…

> I did not know if my concern was correct, and wondered if it was, what else it might affect. That’s exactly what I mean by casting doubt. If the concern might not be correct, why lead into speculation about further concerns? Let’s find out what the actual reason that TypeScript is measured slower, rather than guess as what else could be wrong if unverified theoretical assumptions might be correct.

> rather than guess as what else could be wrong if unverified theoretical assumptions might be correct.

You mean, I should not have explored the ramifications of what my suspicions might mean to so people might think it's worth actually looking into? What's wrong with that?

I can't help but feel that you feel compelled to defend your original position that I believe was based on a misinterpreting my point and intention.

I saw what I believed might be a problem. I noted it. I noted why. I noted what it might mean to the analysis because if my suspicion as to the reason was correct, it might not be isolated and other items might need a closer look. I did so in a way where I was sure not to claim something as factual when I wasn't certain. What part of that do you think is an inaccurate assessment of what I did or was unwarranted?

Edit: Changed misconstruing to misinterpreting, as that's what I was trying to express, and misconstruing might be interpreted as a purposeful action, which is not what I was trying to express.

Re: Which Programming Languages Use the Least Electricity? (2018)

#43
post #36

How does "TypeScript" come out to an energy score of 21.50 when "JavaScript" has a score of 4.45 - that makes 0 sense.

maybe they included compilation? it would make sense as that's a real world use of cpu/memory/energy.

But it certainly looks like they didn't include compilation time for all of the compiled-to-machine-code languages. C has the reference value of '1'.

Re: Which Programming Languages Use the Least Electricity? (2018)

#44

Assembly language is the lower bound here. This is a 100% correct fact that nothing can use less energy than assembly language. No such statement can be made about other languages.

Not necessarily. Sometimes compilers give better programs than a programmer can with optimization and stuff.

Re: Which Programming Languages Use the Least Electricity? (2018)

#46
post #36

How does "TypeScript" come out to an energy score of 21.50 when "JavaScript" has a score of 4.45 - that makes 0 sense.

maybe they included compilation? it would make sense as that's a real world use of cpu/memory/energy.

What about the energy fixing bugs in JS that Typscript found at compile time?

Re: Which Programming Languages Use the Least Electricity? (2018)

#47

Not sure what to make of this research. It's not like I can switch out JS in favor of these other languages (many of which are compiled binaries) in my web apps. The performance of for example web servers written in the different languages entirely would seem more interesting to compare. The JS/TS comparison was directly fishy. I found no mention in the paper of how they managed to "run" the tasks in Typescript, whic…

>Not sure what to make of this research. It's not like I can switch out JS in favor of these other languages

Nope but for iot devices or anything in a scenario with scarce energy resources or difficulty to remove heat it's an interesting datapoint. Although I think the results conform mostly with intuition. I doubt anybody would voluntarily compile a lot of haskell on their space satellite

Re: Which Programming Languages Use the Least Electricity? (2018)

#48

How does "TypeScript" come out to an energy score of 21.50 when "JavaScript" has a score of 4.45 - that makes 0 sense.

If I'd hazard a guess before reading the article, it's because of the transpilation phase to regular Javascript. That doesn't come for free.

Re: Which Programming Languages Use the Least Electricity? (2018)

#49
post #36

How does "TypeScript" come out to an energy score of 21.50 when "JavaScript" has a score of 4.45 - that makes 0 sense.

maybe they included compilation? it would make sense as that's a real world use of cpu/memory/energy.

Still doesn't make sense. Build one time, run many times.

Re: Which Programming Languages Use the Least Electricity? (2018)

#50
post #4

Interesting results, but I think the farther you go down the list the more the fact that you're using the Computer Language Benchmark Game affects what you're seeing, as not all languages get the same attention. For example, Javascript and Typescript. Theoretically, I would assume those to be very close, since one compiles to the other. And for memory usage, they are very close. But for running time, Typescript is an…

I'd be very interested in seeing a few energy benchmarks not here, for example: energy to route 1B hits to a web endpoint, energy to parse a Json, energy to grab an auth token from a web request and forward to an auth server. Energy to forward 1M 1k files from the filesystem to the network, etc.
Post reply on HN