Hacker News new | ask | show | jobs
by MiroslavPokorny 72 days ago
Javascript only becomes fast because most of the CPU time is spent in native code rather than actual compiled or interpreted javascript.

The big diff between scripted and compiled languages is the former dispatches by name and the later dispatches by index. No surprises which is faster and which can be compiled in the faster native code.

1 comments

JavaScript only becomes fast because it continually is making tradeoffs to decide what level of work to put into running any given bit of code. For a while this was three or four different targets on V8 (which I think maybe is down to just 2 now again).

Compiled vs interpretted is viewing this through the compiled language lens. I think the interesting part is that some runtimes are dynamically deciding how to run the code. The contrast versus those folks who decide and bake every single decision in ahead of time, where the only thing that happens is totally pre-scripted, is strong.

Stop Writing Dead Programs is such a lovely talk that hopefully can shake a couple of these sleepers awake, get us to see how absurd compiled code really is. And is quite fun and funnily said. https://news.ycombinator.com/item?id=33270235