News for hackers. Stuff that matters.
Re:Sustainability with Rust by igouy on Saturday February 12, 2022 @02:40PM (#30315620)
> It's based on The Computer Language Benchmarks Game…

It's based on these 4 year old programs —

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

> … the same program ported to N languages…

You can write Fortran in any language ?

----

> … no one bothered to cp fast-solution.js fast-solution.ts.

Perhaps figuring out correct type annotations was too much of a barrier.

Re:Sustainability with Rust by scottlamb on Saturday February 12, 2022 @07:48PM (#30317941)
> > It's based on The Computer Language Benchmarks Game…

> It's based on these 4 year old programs —https://github.com/greensoftwarelab/Energy-Languages

Yes, that repo's blurb confirms what I said: "The complete set of tools for energy consumption analysis of programming languages, using Computer Language Benchmark Game"

If you were making some other point, I missed it. As for the programs being four years old, the paper was published in 2017, so that's exactly as expected...

> > … no one bothered to cp fast-solution.js fast-solution.ts.

> Perhaps figuring out correct type annotations was too much of a barrier.

Sure, the details don't interest me. The point is that these two languages with identical compilers (TypeScript gets translated to JavaScript, discarding you're annotations) show wildly different scores, which makes it impossible to take any of these numbers too seriously.

Re:Sustainability with Rust by igouy on Saturday February 12, 2022 @08:05PM (#30318045)
> … I missed it.

Your "painstakingly optimized with SIMD" doesn't apply much to those 4 year old programs.

> … which makes it impossible to take any of these numbers too seriously.

Never throw the baby out with the bath water.

Never take any numbers too seriously, just seriously enough.

Re:Sustainability with Rust by scottlamb on Saturday February 12, 2022 @08:54PM (#30318352)
> Your "painstakingly optimized with SIMD" doesn't apply much to those 4 year old programs.

What's this then? https://github.com/greensoftwarelab/Energy-Languages/blob/ma... There are some explicit SIMD instructions, and some programs written to allow autovectorization.

> Never throw the baby out with the bath water.

/eyeroll

There's no baby. There's no significant investment in applying equal levels of optimizations to the programs across languages. TypeScript vs JavaScript is a telling example but hardly the only one.

Re:Sustainability with Rust by igouy on Monday February 14, 2022 @01:32PM (#30336037)
> There are some explicit SIMD instructions, and some programs written to allow autovectorization.

Yes there were some way back then.

Many more have been contributed since then.

> … equal levels of optimizations to the programs across languages.

How do you propose to measure that exactly?

Or will we like Goldilocks know it when we see it?

Like these —

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

Re:Sustainability with Rust by scottlamb on Monday February 14, 2022 @04:47PM (#30338844)
Oh, it just clicked for me that you are the Game' maintainer.

> How do you propose to measure that exactly?

I don't have a proposal, other than to avoid overselling. I like that the Game's website has the text "If the fastest programs are manually vectorized SIMD, does the host language matter? You might be more interested in less optimised programs." The "Energy Efficiency across Programming Languages" paper though is overselling its rigor.

Re:Sustainability with Rust by igouy on Tuesday February 15, 2022 @12:02PM (#30349176)
Yeah, sorry about that, peoples comments usually seem more open before they realize.

It's difficult to find a balance that works — otoh for some hints give a context, otoh for others hints give stones to throw ;-)