Live data from Hacker News

Which Programming Languages Use the Least Electricity? (2018)

thenewstack.io

71–80 of 267 posts

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

#71
post #59

I'm a little surprised at where Erlang features in the list. I've never used it personally, but have heard so much about it being an amazing, performant language. I wonder why it's so time/energy/memory inefficient for the algorithms used in this exercise.

Is this the cost of restarting processes due to "let it crash" error handling?

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

#74
post #59

I'm a little surprised at where Erlang features in the list. I've never used it personally, but have heard so much about it being an amazing, performant language. I wonder why it's so time/energy/memory inefficient for the algorithms used in this exercise.

Is this the cost of restarting processes due to "let it crash" error handling?

No idea, but I doubt it if they're testing with well defined algorithms. I can't imagine the tests throwing lots of errors.

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

#75
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…

> Theoretically, I would assume those to be very close, since one compiles to the other.

I don't think that's a safe assumption. The Javascript results would be a lower bound (assuming the same algorithm, etc.), but there's no telling what "extra" Javascript (and thus overhead) might be inserted by the Typescript compiler.

As far as individual results go, there's no point jumping to conclusions when the results and code are available online and easy to try for yourself:

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Typescript is still 2-3x slower than Node in several of the benchmarks, and the results could have been different in May 2018 when the article was written.

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

#76
post #10

PHP's performance is quite impressive nowadays. It's one of the top fastest interpreted languages.

For how much shit PHP gets, it is a pretty good lang for building things

I'm curious: I've used PHP (not by choice) for the past two years and I strongly dislike it. (I could wax eloquent on this subject, but I don't want a flame war. :) What do you see of value in PHP? Is it the language itself? Its ecosystem or community?

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

#77
post #59

I'm a little surprised at where Erlang features in the list. I've never used it personally, but have heard so much about it being an amazing, performant language. I wonder why it's so time/energy/memory inefficient for the algorithms used in this exercise.

Erlang's use case is handling lots of connections simultaneously, and messaging between processes.

These benchmarks are all single-threaded, pure computation. Erlang is pretty slow at that (alas).

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

#78
post #73

Aren't the savings more in the type of application? For example, driving users to addictive content makes them use their phone more. Also, Bitcoin comes to mind.

To me, the amount of electricity used is a similar issue to RAM. Just because we have computers with more RAM does NOT mean programs NEED to use that RAM. So many applications right now that don’t need as much memory as they are using but, whether it be lazy or poorly planned code or any other excuse, they guzzle it up like they are the only application running on your device.

I’m all for figuring out what’s the most efficient option while also ensuring it’s an effective one as well. If you kept a knife in its sheath to keep it nice, but never take it out to use it, then it’s not servicing its purpose as a tool (ignoring ornamental ones). However, no matter how cool it might seem, you really don’t need a samurai sword to pear apples.

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

#80
post #65

Earlier quoted context omitted.

it is absolutely a flaw in the methodology, but one I think is unavoidable without enormous resources.

It took me about a minute looking at their published detailed data to notice the problem. They should have noticed a factor-of-15ish outlier and checked why on earth it was there.

That's not how the game works. The community "plays the game" by submitting better benchmarks when they come up with better solutions.
Post reply on HN