News for hackers. Stuff that matters.
Re:Which Programming Languages Use the Least Electricity? (2... by hn_throwaway_99 on Friday March 29, 2019 @08:10PM (#19526670)
How does "TypeScript" come out to an energy score of 21.50 when "JavaScript" has a score of 4.45 - that makes 0 sense.
Re:Which Programming Languages Use the Least Electricity? (2... by prickledpear on Friday March 29, 2019 @11:10PM (#19527429)
Their typescript compiler may not be targeting the correct ecmascript version so the typescript generated could be using polyfills instead of native features.
Re:Which Programming Languages Use the Least Electricity? (2... by snek on Friday March 29, 2019 @08:15PM (#19526702)
maybe they included compilation? it would make sense as that's a real world use of cpu/memory/energy.
Re:Which Programming Languages Use the Least Electricity? (2... by hn_throwaway_99 on Friday March 29, 2019 @08:25PM (#19526742)
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? (2... by jandrese on Friday March 29, 2019 @10:05PM (#19527154)
I think they included compile time if the code is JITed at startup.
Re:Which Programming Languages Use the Least Electricity? (2... by recursive on Friday March 29, 2019 @08:30PM (#19526765)
Still doesn't make sense. Build one time, run many times.
Re:Which Programming Languages Use the Least Electricity? (2... by quickthrower2 on Friday March 29, 2019 @08:27PM (#19526751)
What about the energy fixing bugs in JS that Typscript found at compile time?
Re:Which Programming Languages Use the Least Electricity? (2... by kakarot on Friday March 29, 2019 @08:30PM (#19526760)
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.