3 ms·
What's wrong with using JS source as the intermediate representation? It's probably even easier to write a [DYN LANG X] to [WELL KNOWN JS] translator than [DYN
by gojomo 18y ago
What's wrong with using JS source as the intermediate representation? It's probably even easier to write a [DYN LANG X] to [WELL KNOWN JS] translator than [DYN LANG X] to [NEW V8 BYTECODES].
It's just a slightly different path to the same final machine code running in the same environment, and neither the conversion to JS nor the alternate theoretical conversion to bytecodes may be a noticeable bottleneck in real apps.
(Also: I'm not even sure his assumption is correct. V8 might use some intermediate representation that other languages could target in preference to JS source. Someone who's familiar with the source/architecture would have to say.)
- maxwell 18y agoYou're right. JavaScript is a great intermediate format, even if it's not the best source language. The OP was right about JavaScript compiling straight down to machine code though: http://code.google.com/apis/v8/design.html#mach_code http://code.google.com/apis/v8/design.html#mach_code