

Why is there no script bytecode? - jlebrech

asm.js is the nearest thing to it, but V8 has a internal bytecode and it&#x27;s a shame it cannot be precompiled and included as a script type.
======
zamalek
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...](http://stackoverflow.com/questions/11109538/node-js-v8-how-to-
make-my-own-snapshot-to-accelerate-startup)

~~~
mraleph
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.

------
Piskvorrr
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.

~~~
jlebrech
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.

~~~
Piskvorrr
...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").

------
mraleph
V8 has _no_ internal bytecode.

