lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Oct 26, 2010 at 12:57 AM, Philippe Lhoste <PhiLho@gmx.net> wrote:
> Somehow, it could be interesting if JavaScript (ECMAScript) had a define
> bytecode format, like Java. Parsing textual code to interpret it seems to be
> a waste of CPU. One can make his own bytecode and a VM in JavaScript to
> interpret it, but that's still an unnecessary layer, IMHO.

Somehow I doubt that browser vendors would expose such a bytecode
format if there was one. Lua 5.1 dropped the bytecode verifier due to
the work and imprecision involved (I think), and running invalid
bytecode in general would likely cause the browser (or at least the
tab) to crash. It could potentially create new security holes. It
might be possible to write a bulletproof bytecode verifier, but by
that point, what's the difference? You're still processing the code
before you run it.

~Jonathan