Re:The Elusive Universal Web Bytecode
by TazeTSchnitzel on Thursday March 26, 2015 @02:00PM
(#9271759)
> The problem is JavaScript-as-bytecode is not especially easy to improve. Anything you want to add/change that would make it a better bytecode has to be balanced with the language's use by humans.
There are very few cases where human use causes problems. goto is the only one I can think of. Yet we've gotten loads of great improvements in ES6 to make it a good compiler target, like float32 and better integer multiplication.
The problem is JavaScript-as-bytecode is not especially easy to improve. Anything you want to add/change that would make it a better bytecode has to be balanced with the language's use by humans.
The solution to one-VM-to-rule-them-all is not to cram everything into a higher-level system with lots of assumptions (JavaScript) or to ignore portability (NaCl, LLVM), but to use a bytecode that's low-level enough to implement the various assumptions needed by higher layers.
That way both C++ and JavaScript can run at full speed as well as have their implementations changed (even across websites!) without pushing every change through the browsers- just like native apps, with the browser providing only cross-platform and security, nothing more.