2 ms·
Imagine the amount of GWh saved if JS had been static-typed with inference.. For decades billions of processors have been burning watts to dereference JSValue
by alcover 3y ago
Imagine the amount of GWh saved if JS had been static-typed with inference..
For decades billions of processors have been burning watts to dereference JSValue *val, then switch() on the union tag (or something like that).
- panick21_ 3y agoStatic typing doesn't make everything fast by itself. In fact once your static typing is sufficiently advanced, you run into many of the same problems in terms of optimizing. What is actually baffling is that Sun had Self with super advanced compilation, the highest performant dynamic language and instead of using that, JS happened. And the people who did Self, then went off did Strongtalk HotSpot, then Java HotSpot then were bought by Sun again. And then eventually Google hired the exact same team to do the same thing for Chrome (and then later Dart). So really just using Self would have saved a solid 10+ years of detours only to end up with what Sun had in its labs in 1992.