3 ms·
JavaScript compiles to native code.
by nawitus 13y ago
JavaScript compiles to native code.
- Kenji 13y agoYes, I'm aware of that, but at soon as you interact with the DOM, a canvas, etc, you reintroduce all the overhead that you wanted to circumvent with compilation. And JavaScript without DOM interaction is rarely useful in a browser. For node.js, on the other hand, it sure is awesome. I didn't want to imply that JavaScript itself is necessarily slow, it isn't.
- nawitus 13y agoWell, DOM and the canvas elements empirically are somewhat slow, but there's no inherent reason that makes them slow. Besides, if we're talking about something like a game, you can draw the final output to the canvas at a single step which is not the bottleneck.