325 karma · joined March 25, 2013
Also, there’s immense value in text formats over binary formats in general, especially for open, extendable web standards. Text formats are more easily extendable as the language evolves because they typically have some amount of redundancy built in. The W3C outlines the value here (https://www.w3.org/People/Bos/DesignGuide/implementability.h...). JS text format in general also means engines/interpreters/browsers are simpler to implement and therefore that JS code has better longevity.
Finally, although WebAssembly is a different beast and a different language, it provides an escape hatch for large apps (e.g. Facebook) to go to extreme lengths in the name of speed. We don’t need complicate JavaScript with such a powerful mechanism already tuned to perfectly complement it.
[0]: https://github.com/syg/ecmascript-binary-ast/#-2-early-error...
Disclaimer: I work on the V8 team.
[0]: http://webassembly.org/docs/future-features/#source-maps-int...
It's not so simple as (paraphrasing) 'ES6 is sugar and makes ES5 regress in speed.' Generally, "make it work right, then make it work fast" is actually a pretty good strategy for implementing new features.
Strong mode work was stopped for a variety of nuanced reasons detailed here [1].
(Disclaimer: I'm a PM on the V8 team.)
[0]: https://twitter.com/addyosmani/status/699976753255751681 [1]: https://groups.google.com/forum/#!topic/strengthen-js/ojj3TD...
It's important to remember that implementation of ES2015 is merely the first pass; optimization comes soon after and will rapidly improve performance. General, absolute numbers (e.g. "ES2015 is X% slower than ES5") are usually either nonspecific or soon out-of-date. The best advice is to revise your performance assumptions frequently based on real code.
r.e. ES5 side-effects: ES2015 adds language features and changes semantics of existing features in ways that necessarily change the execution path of code (including ES5 code). When V8 first tried implemented proper (ES2015) RegExp subclassing, for example, it regressed existing (ES5) RegExp performance by ~70%, but a subsequent optimization reduced the regression to ~9%. This is an unfortunate consequence of a rapidly evolving spec, but these cases are exceptional and will get better over time.
(Disclaimer: I'm a PM on the V8 team.)
[0]: https://github.com/WebAssembly/design/blob/master/Web.md#web... [1]: https://github.com/WebAssembly/design/blob/master/NonWeb.md
[0]: https://groups.google.com/a/chromium.org/forum/#!topic/blink...
[0]: https://www.w3.org/community/webassembly/
[1]: https://github.com/WebAssembly/design/blob/master/TextFormat...
[2]: https://github.com/WebAssembly/design/blob/master/Tooling.md
The primary advantage of LEB128 is (as you mentioned) that it's a relatively common encoding. PrefixVarint is not an open source encoding IIUC.
We'll do some experiments in terms of speed. If the gains are significant we may be able to adopt something similar (this [0] looks like a related idea).
Thanks for the suggestion.
The goal of WebAssembly is to open up the reach and easy user experience of the web browser to new types of applications that just aren't possible to build efficiently with current tech.
We're also making sure that wasm is a first-class citizen of the open web: see, for example, our thoughts around ES6 module interop, GC + DOM integration, and view-source to see the textual encoding of wasm [0][1].
[0]: https://github.com/WebAssembly/design/blob/master/Web.md
[1]: https://github.com/WebAssembly/design/blob/master/TextFormat...
(Disclaimer: I work on V8.)
Since the last time WebAssembly hit HN, we've made a lot of progress designing the binary encoding [1] for WebAssembly.
(Disclaimer: I'm on the V8 team.)
[0]: http://webassembly.github.io/ [1]: https://github.com/WebAssembly/design/blob/master/BinaryEnco...
tl;dr we're changing engines mid-flight and that has as much to do with performance differences as the ES6 features themselves.
[0]: http://blog.chromium.org/2010/12/new-crankshaft-for-v8.html [1]: http://v8project.blogspot.com/2015/07/digging-into-turbofan-...
In general, we will focus on improving the performance of the most-used features first. Arrow functions, generators, etc. are high on the list.
[0]: https://twitter.com/addyosmani/status/699976753255751681
(Disclaimer: I'm a PM on the V8 team)
Disclaimer: I work on V8
[0]: https://kangax.github.io/compat-table/es6/
(Disclaimer: I'm a PM on the V8 team)
[0]: https://github.com/WebAssembly/design/blob/master/FAQ.md#is-...