2 ms·
In a better world, the browser-borne language with access to DOM and other features would be small, stable, and the "transpiling" would be plain compilation. U
by nine_k 9y ago
In a better world, the browser-borne language with access to DOM and other features would be small, stable, and the "transpiling" would be plain compilation.
Unfortunately, both Netscape and MS wanted control, and then it was too late.
- pcwalton 9y agoThis wouldn't be the right solution if you wanted to avoid the problem in the article. For-of has subtle semantics around exceptions. When you have to spell them out explicitly at every call site, which is what would happen with a small VM, you get the code bloat described in this article.
- nine_k 9y agoI'd rather have a language which is not specific to the browser, and browsers offering a compilation target, like LLVM / CLR / JVM. A simpler compilation target would hopefully lack semantic subtleties. Now we can have this, too, of course, and e.g. run Clojure or Elm in a browser, compiled down to a safer / better supported subset of JS, or use ES7 with polyfills. But the intention of browser vendors is currently different; WebAssembly, while a small and well-defined VM, is not intended as a JS peer, let alone replacement, though.
- wolfgke 9y ago> I'd rather have a language which is not specific to the browser, and browsers offering a compilation target, like LLVM / CLR / JVM. A simpler compilation target would hopefully lack semantic subtleties. I would rather claim that all common VM targets, such as LLVM, CLR, JVM etc. are so full of semantic subtleties that the subtile parts of JavaScript are quite harmless against them.