Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
hn_throwaway_99
· 7y ago · 0 comments
How does "TypeScript" come out to an energy score of 21.50 when "JavaScript" has a score of 4.45 - that makes 0 sense.
Comments
[–]
prickledpear
7y ago
Their typescript compiler may not be targeting the correct ecmascript version so the typescript generated could be using polyfills instead of native features.
[–]
snek
7y ago
maybe they included compilation? it would make sense as that's a real world use of cpu/memory/energy.
[–]
hn_throwaway_99
OP
7y ago
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'.
[–]
jandrese
7y ago
I think they included compile time if the code is JITed at startup.
[–]
recursive
7y ago
Still doesn't make sense. Build one time, run many times.
[–]
quickthrower2
7y ago
What about the energy fixing bugs in JS that Typscript found at compile time?
[–]
kakarot
7y ago
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.