Live data from Hacker News

Which Programming Languages Use the Least Electricity? (2018)

thenewstack.io

201–210 of 267 posts

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

#201
post #29

Earlier quoted context omitted.

So why is the TypeScript bench slower?

My best guess: probably written by someone that doeant know how to write performance TS. I say this with no skin in the game. I write neither JS nor TS. What I have observed in language benchmarks over the years, is that the benchmarks are rarely written by an expert, but usually by someone with cursory knowledge of the language. E.g. just enough to be dangerous. Often times, these sorts of benchmarks are done with p…

This is unfortunately pure speculation on top of pure speculation, which is the problem I have with the top comment. You’re assuming incompetence when you could just go look it up. Why assume it’s someone who doesn’t know? Why use that to wander off into rant land about prejudices and make broad claims that internet benchmarks are bad, when you admit to having zero idea what the actual specific problem here is?

The test that lowered TypeScript’s score in the paper is called fannkuch-redux, and here are the sources in question:

https://github.com/greensoftwarelab/Energy-Languages/blob/ma...

https://github.com/greensoftwarelab/Energy-Languages/blob/ma...

They are both contributed by the same person, and there is no bubble sort involved. So now you know.

I don’t see an obvious reason one would be slower, but they’re also quite different. Maybe the algorithmic complexity is different. Maybe the cross-compilation is doing something bad with memory allocation. Note the input sizes for this test are very small, it would be easy for a difference in temporary variables the compiler injects to cause a serious problem.

What is not obvious is any prejudice, malice, or incompetence.

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

#202

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.

Compiled Forth would give Assembly a run for its money and produce smaller code as well.

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

#203
post #171

Earlier quoted context omitted.

I think 'safety' is the key term here. In the future we will see more self-driving cars and other self-... machines. I would like them to provably not crash (into me). If it were up to me, no matter the energy consumption, a piece of software in that realm should be proven correct (both crash-free and doing what the specification says).

> a piece of software in that realm should be proven correct (both crash-free and doing what the specification says)... You do realize that a lot of autonomous driving software uses ML techniques that make providing guarantees like that difficult, right? (To be honest, oftentimes we can't even provide an explanation of why an ML decision was made, let alone "prove" why an ML decision is made. We only show tha most of…

> Almost 0% chance any reputable company relies on something like go or swift to drive an automobile out on public roads.

You couldn’t be more wrong. Tesla hired the creator of Swift to run Autopilot software.

He’s now at Google where he’s working on making Swift a primary language for TensorFlow.[1]

[1] https://youtu.be/s65BigoMV_I

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

#204

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.

Compiled Forth would give Assembly a run for its money and produce smaller code as well.

But could forth beat compiled Assembly language? I think not.

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

#205

Earlier quoted context omitted.

If you're still using COBOL, power usage is likely very low on your list of concerns

No? Just about any financial transaction, insurance calculation and a lot of telcos operations run mainly of cobol. Something like 90% of all credit card transactions.

You can throw money at electricity use, and COBOL is compiled to machine code so the power usage is much less of a concern than it would be in an interpreted language.

Much higher on the list of concerns is finding capable COBOL developers, ongoing maintenance, and security. Those are all things that you can't just throw money at.

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

#206
post #42
post #34

Earlier quoted context omitted.

> 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 intenti…

You saw what you believed might be a problem. You did not investigate whether or not it was a problem. Instead you speculated about what it might mean to the analysis.

The part that was unwarranted was the negative speculation.

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

#207
post #167

Earlier quoted context omitted.

Go's GC is not really pushing the envelope. They have merely improved from a STW, non-compacting, non-generational collector with a 25% CPU overhead to a concurrent, non-compacting collector with reasonable overhead. JVMs and CLR had those a decade ago. The state of the art are concurrent, compacting, region-based pauseless or millisecond-pause collectors.

Comparing Go's GC to one of the many specialized fine-tunned Java GCs is pointless, I find. I'm sure you're also aware that recent Go's GC pauses are sub millisecond for most use cases: "We now have an objective of 500 microseconds stop the world pause per GC cycle." - 2018 Go team https://blog.golang.org/ismmkeynote My personal experience with microservices is to expect STW pauses in the 350 microsecond range. The b…

I was talking about technology state of the art, not out-of-the-box experience.

OpenJDK's default collector - parallel or G1GC, depending on version - is not the best available among JVMs and if your goal is pause times then yes, it will be worse than Go's. But if you switch to say C4 or ZGC you'll get comparable pause times and compacting on top and being able to scale to terabyte heaps.

10 years ago we had Metronome and CMS, which are more comparable to Go's collector.

And pause-times are not everything. Throughput and fragmentation resistance matter too. Compacting collectors fare much better on the latter metric. I don't know how the former is now, but those slides talked about 25% GC overhead in older versions of Go, that's utterly terrible.

Go is facing one challange that java doesn't: internal pointers. But the CLR's collectors have to deal with those too, so that's not terra incognita either.

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

#208

Earlier quoted context omitted.

> 1 - Why would you want to replace java on the server? Well one reason, if you look at the paper, is memory consumption. One of the ways Java gets good performance despite being a GC'd language is less efficient memory usage. (Although there are many advancements in this area akin to what Go has accomplished but as the paper's metrics show, often Java uses a lot of mem.) Also probably lots of people will agree that…

>* is memory consumption...* ??? You're recommending a slower language, that uses more watts, on a presumably 24/7 backend... to save a few bucks on memory? As I said, if you want a company to switch to c++ or rust because you want to save money on memory IN ADDITION to all the money you're saving on watts, while getting the same or better performance? That might make some sense. Switching to go makes, No , sense. Yo…

You’re misrepresenting my statements. I believe I’ve been clear that it’s early days for these languages and that they are good candidates to supplant Java in the future based on their trajectories. Memory utilization is just one efficiency advantage of a reference counted language like Swift. There are other reasons to look beyond Java as well.

Also, a request. Try to take it easy on the ???, all caps and excessive italics.

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

#209

Earlier quoted context omitted.

> a piece of software in that realm should be proven correct (both crash-free and doing what the specification says)... You do realize that a lot of autonomous driving software uses ML techniques that make providing guarantees like that difficult, right? (To be honest, oftentimes we can't even provide an explanation of why an ML decision was made, let alone "prove" why an ML decision is made. We only show tha most of…

> Almost 0% chance any reputable company relies on something like go or swift to drive an automobile out on public roads. You couldn’t be more wrong. Tesla hired the creator of Swift to run Autopilot software. He’s now at Google where he’s working on making Swift a primary language for TensorFlow.[1] [1] https://youtu.be/s65BigoMV_I

[deleted]

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

#210
post #60
post #34

Earlier quoted context omitted.

> 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.

You can look at their detailed data and sources here https://sites.google.com/view/energy-efficiency-languages/ho... Many benchmarks have no TS implementations, TS/JS results are about the same except for fannkuch-redux which is about a zillion times slower in the TS implementation. When looking at that kind of massive discrepancy in similar languages with the same runtime, the guess kbenson made was a perfectly sens…

> when using the benchmark game as a starting point.

In fact, on the benchmarks game website, those same programs do not show a "massive discrepancy" --

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

Post reply on HN