3 ms·
If you do absolutely zero instruction optimization or re-ordering. Literally mapping the BNF grammar to a syntax tree capable of simple syntactic reduction...
by cjhanks 8y ago
If you do absolutely zero instruction optimization or re-ordering. Literally mapping the BNF grammar to a syntax tree capable of simple syntactic reduction... I would be surprised if it did not lag behind disk read speeds.
Traversing that tree to remove unambiguous dead branches seems pretty clear. Perhaps if you get into a tricky manipulation between strings and syntax you could add a little runtime...
- yzmtf2008 8y agoIf you do absolutely zero instruction optimization or re-ordering, JavaScript takes 0 seconds to compile, and you can use almost-complete feature set of ES6. /s Come on man, that's beyond the point. Just because JavaScript needs to be compiled, doesn't mean it has a worse experience than compiling C++.
- cjhanks 8y agoInstruction optimization is procedure of measuring expected CPU latency given the expected current state to identify which instruction set transition is optimal for the CPU. It would not be applicable to JavaScript unless I missed something. Instruction ordering is largely bound to instruction pipelining and the estimation of CPU instruction transitioning to reduce latency. Given that V8 uses some degree of virtual indirection... I don't think that's possible in JavaScript.