News for hackers. Stuff that matters.
Re:W3C recommends WebAssembly by bogwog on Friday December 06, 2019 @10:47AM (#21722784)
Hopefully this also means that Javascript is going away for good
Re:W3C recommends WebAssembly by siempreme on Friday December 06, 2019 @12:06PM (#21723725)
Indeed, and it's entire spaghetti/duck-taped eco system including: babel, react, vue, angular, typescript, name it. Can't wait for that day..
Re:W3C recommends WebAssembly by k__ on Friday December 06, 2019 @10:58AM (#21722910)
I think people starting to pump giant binaries to the browser will lead to JavaScript leveraging its strengths and getting even better.
Re:W3C recommends WebAssembly by asdfman123 on Friday December 06, 2019 @11:14AM (#21723091)
I don't get why binaries should be more bandwidth-intensive than JS.

I guess in a sense you already have the JS engine installed with, say, Chrome, which is essentially a runtime.

Why can't other runtimes come prepackaged? What am I missing here?

Re:W3C recommends WebAssembly by bhaak on Friday December 06, 2019 @11:57AM (#21723626)
Nobody wants another fat runtime that is as entangled with the browser engine as the JS engine is.

Getting the JS engine to be fast was a tremendous trouble and you wouldn't want to sink as much engineering power into another runtime that will have a smaller reach than the JS engine.

Rather use that skills to make WASM faster.

Re:W3C recommends WebAssembly by krapp on Friday December 06, 2019 @05:04PM (#21726450)
> Nobody wants another fat runtime that is as entangled with the browser engine as the JS engine is.

Why would it need to be? There's no reason to assume the architectural decisions for javascript have to be repeated for WASM.

The runtimes themselves could be WASM binaries cached like any other resource, or managed like packages. Javascript could be disentangled from the browser by doing the same - just treating it as a resource that ships by default with the browser.

I don't know if that's feasible - maybe not - but I bet there are possibilities other than "ship the entire runtime with each script" that can be considered.

Re:W3C recommends WebAssembly by bhaak on Saturday December 07, 2019 @07:11PM (#21733538)
I thought you meant adding other scripting languages to the browser. Not a WASM runtime.

That's likely still not a good idea. A specific runtime is likely to be outdated fast. That's like asking why the JQuery library wasn't shipped with the browsers themselves.

For runtime with a significant size, it's probably going the same way as JQuery. Have a CDN host it so different websites can use it and leverage the browser's cache.

Re:W3C recommends WebAssembly by bogwog on Friday December 06, 2019 @11:06AM (#21723003)
> I think people starting to pump giant binaries to the browser

As if that's not already happening today with obfuscated and minified javascript

Re:W3C recommends WebAssembly by krapp on Friday December 06, 2019 @11:08AM (#21723029)
Those aren't technically binaries, as much as people want to cling to the metaphor of javascript as "bytecode" and pretend no distinction exists between the two.
Re:W3C recommends WebAssembly by bogwog on Friday December 06, 2019 @11:30AM (#21723298)
> and pretend no distinction exists between the two.

What's the distinction then? That obfuscated javascript can be looked at by people who don't know how to use a hex editor?

Re:W3C recommends WebAssembly by krapp on Friday December 06, 2019 @11:35AM (#21723371)
Javascript-as-bytecode is a metaphor, not a technical description. Javascript is not actually bytecode in the same way that a .java file is not java bytecode.
Re:W3C recommends WebAssembly by bogwog on Friday December 06, 2019 @11:52AM (#21723571)
Okay. Thanks for that.
Re:W3C recommends WebAssembly by k__ on Friday December 06, 2019 @01:22PM (#21724560)
That's what I meant.

JS can do better, and it will if other languages can do things it does now.

Re:W3C recommends WebAssembly by krapp on Friday December 06, 2019 @11:07AM (#21723013)
It doesn't. Browsers will have to continue to support javascript indefinitely, simply because doing otherwise would break most of the web.

Also, the use cases for javascript and webassembly don't overlap enough for one to replace the other in most cases. Javascript is a text-based scripting language you can write in any editor (the sprawling morass that is the current js development ecosystem notwithstanding,) but WASM requires knowing another language and having a compile step, which adds friction and complexity. You can't really replace a language with a bytecode.

It may mean that other languages can be deployed in the browser as easily as javascript, which may or may not be good depending on your point of view.

I personally look forward to the day when Hacker News embeds the Arc runtime as WASM and replaces all of their javascript with Arc code.

Re:W3C recommends WebAssembly by bogwog on Friday December 06, 2019 @11:34AM (#21723350)
> It may mean that other languages can be deployed in the browser as easily as javascript, which may or may not be good depending on your point of view.

That's exactly what I hope happens. There are so many good languages out there that having to be stuck with javascript for the modern web is a crime.

Re:W3C recommends WebAssembly by MaxBarraclough on Sunday December 08, 2019 @07:43AM (#21735614)
Also, WebAssembly doesn't have everything JavaScript has. Garbage collection and support for older browsers, for instance.

> WASM requires knowing another language and having a compile step, which adds friction and complexity. You can't really replace a language with a bytecode.

I'm not sure that requiring a build step is a real problem, for web 'applications' at least. Plenty of JavaScript frameworks use a build step anyway.

Re:W3C recommends WebAssembly by zelly on Friday December 06, 2019 @12:39PM (#21724103)
It's not the end of JavaScript. It's the end of every language that "compiles to" JavaScript.