Why is there no script bytecode?

1 points by jlebrech ↗ HN
asm.js is the nearest thing to it, but V8 has a internal bytecode and it's a shame it cannot be precompiled and included as a script type.

7 comments

[ 2.7 ms ] story [ 30.5 ms ] thread
Precompiled for what platform? We're kind of past the stage "everything is Wintel x86" nowadays: a lot of JIT compilation derives its power from platform-specific optimizations.
I mean an intermediary like java.

another option would be to have a <script arch='arm' src='compile.arm.bytecode' /> and compile for various architectures before hand.

...times various JS interpreters, times various browsers, and keeping all those in sync? Sounds like a support nightmare combined with several attack vectors ("sure, the precompiled version is the same as the original, and doesn't try any funny stuff with pointers, either").
There is, somewhat, support for this: v8 snapshot. It's very poorly documented (VERY), but I did come across this which might be a good place to start clicking links: http://stackoverflow.com/questions/11109538/node-js-v8-how-t...
and asm.js is optimised for those snapshots right?
V8 snapshot is nothing like bytecode, it a serialized native heap with architecture dependent native code (sic!) embedded into it.

And it still contains all source code for all functions.

V8 has no internal bytecode.