4 ms·
Au contraire: if people can ship WASM to the browser to do what they’re currently doing with JS, but it’s faster, in nearly whatever language they like and just
by FridgeSeal 8y ago
Au contraire: if people can ship WASM to the browser to do what they’re currently doing with JS, but it’s faster, in nearly whatever language they like and just as nice/if not nicer, then they’ll stop writing JS.
I’ve long maintained that the reason that JS is so prelevant and popular is the result of it exclusively being the only language allowed in the browser.
Mozilla has already proven that a Rust WASM can take in the DOM, do all the necessary transformations and hand back the final result faster than JS can transform it. Host binding protocols are the first step in negating the necessity of JS. Once a direct DOM <-> WASM API comes along (and it will), JS will be as good as deprecated.
- krapp 8y agoYou're forgetting two relative benefits to JS - it can be written in a text editor and it doesn't require knowledge of a second language, toolchain and compiler. A lot of javascript is still hand written. Also, deprecating JS would mean deprecating functionality most of the web itself. No one is going to rewrite all existing javascript in Rust or C or whatever and compile it to WASM. Like it or not, as long as the web exists, javascript has to exist, browsers have to support it.
- FridgeSeal 8y ago> it can be written in a text editor Are there programming languages that we don’t use as targets that can’t be written in a text editor? I’m not sure what you mean here. I can write Rust, C, C++, Python, Swift, .Net, etc etc in a text editor with no more difficulty than JS? > it doesn't require knowledge of a second language, toolchain and compiler. A lot of javascript is still hand written. Have you not seen the borderline arcane processes and quantity of tooling involved in “compiling” and bundling JS applications? It’s nightmarish and far more convoluted than literally any other language I’ve dealt with. > Also, deprecating JS would mean deprecating functionality most of the web itself. Oh no, what a pity, large chunks of bloated websites will go away. I’m sure we’ll all miss them greatly, they made such a great difference to our lives. /s > No one is going to rewrite all existing javascript in Rust or C or whatever and compile it to WASM. You don’t have to write it in whatever low-level language, I’m sure any number of higher level languages will get support. Also, we dropped flash pretty hard and fast, and I distinctly, distinctly remember a huge number of websites being entirely flash. It’s maybe not going to go away entirely, but it will hopefully cease to become as popular as it is now.
- afiori 8y ago> Oh no, what a pity, large chunks of bloated websites will go away. I’m sure we’ll all miss them greatly, they made such a great difference to our lives. /s I don't even know how to answer this... You are proposing to partition the web into a past and future version where almost no site of commercial interest has any incentive to leave the old internet. Do you seriously believe that a browser without javascript (not a "noscript" addon, just no javascript) could be successful in any way? or say, more than elinks? > Also, we dropped flash pretty hard and fast, and I distinctly, distinctly remember a huge number of websites being entirely flash. And some sites still requires it. It is one of the reason I still keep chrome on my computers
- Sargos 8y agoSteve Jobs killed Flash. I fully believe that Flash would still be around and kicking (horribly) if he didn't step in and do something about it. Jobs isn't here to save us anymore.
- thefounder 8y agoThere is no issue rewriting JS. People do it anyway every year. I.e new frameworks, new tools etc. JS won't be deprecated. It will just cease to be used (i.e like COBOL)
- austincheney 8y ago> if people can ship WASM to the browser to do what they’re currently doing with JS If if if.... That is not what WASM is or whats to be. > I’ve long maintained that the reason that JS is so prelevant and popular is the result of it exclusively being the only language allowed in the browser. People who hate JavaScript have long maintained that, without evidence. I can remember writing JavaScript long before it became popular and was still everywhere. > WASM API comes along (and it will), JS will be as good as deprecated. A DOM interop spec is underway, which will allow access into the WASM target from JavaScript. It will not allow access from WASM to the DOM, because that is insecure.
- FridgeSeal 8y ago> A DOM interop spec is underway, which will allow access into the WASM target from JavaScript. It will not allow access from WASM to the DOM, because that is insecure. More insecure than allowing arbitrary JS like we do now? I wouldn’t be surprised if we do get a WASM DOM API, maybe it won’t start as an official spec, but it’ll eventually happen.
- afiori 8y agoa DOM API for wasm is planned, but IIRC before that people need to standardize the whole concept of external references/GC, so it might be still quite far away.
- yarg 8y agoAccording to Mozilla : "There are future plans to allow WebAssembly to call Web APIs directly.". https://developer.mozilla.org/en-US/docs/WebAssembly/Concepts https://developer.mozilla.org/en-US/docs/WebAssembly/Concept... Although I couldn't actually find any description of the intended capabilities.
- austincheney 8y agoMDN has a page for that as well: https://developer.mozilla.org/kab/docs/Web/API https://developer.mozilla.org/kab/docs/Web/API The page DOM is not listed there. The closet thing is DOMParser which will allow parsing of an XML/HTML island into a new DOM object. https://developer.mozilla.org/kab/docs/Web/API/DOMParser https://developer.mozilla.org/kab/docs/Web/API/DOMParser
- deleted 8y ago[deleted]