3 ms·
This 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 the
by pcwalton 9y ago
This 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.