News for hackers. Stuff that matters.
Re:Why WebAssembly Is Faster Than Asm.js by throwawaysbdi on Thursday March 16, 2017 @12:38AM (#13882541)
So wasm is a bytecode format like Java or C#'s IL except it basically has no runtime?

Why don't we just use an existing bytecode format and skip all the pointless design? LLVM? Android DEX? Java Class or C# IL formats aren't enough? Hell if we use one of those bytecode formats we could reuse the runtime too!

I'm sure there's probably 20+ bytecode formats and I'm rolling my eyes that we need yet another for the web....

Re:Why WebAssembly Is Faster Than Asm.js by legulere on Thursday March 16, 2017 @04:38AM (#13883457)
Java (including dex) and IL bytecodes are too high level. They assume that everything is laid out in garbage collected classes.

This basically means that programming languages usually have to be specially designed for them. There's ironpython, but it's not fully compatible with python for instance.

LLVM IR is designed as a compiler IR and hardly useful for this usecase, as it is unstable, target-specific and has a complicated largely undocumented bitcode format (I don't know any reimplementations). It has been tried with PNaCl and the original SPIR, but both projects abandoned LLVM-IR/ were abandoned.

Re:Why WebAssembly Is Faster Than Asm.js by Rusky on Thursday March 16, 2017 @12:44AM (#13882571)
This has been brought up several times in this thread, but none of those bytecodes is sufficient. LLVM is not platform-agnostic, JVM/IL are sub-optimal for languages like C++.

None of those platforms' security models are as good as the web's, either, nor are their runtimes able to work well in that context.

Re:Why WebAssembly Is Faster Than Asm.js by coldtea on Thursday March 16, 2017 @05:08AM (#13883576)
>Why don't we just use an existing bytecode format and skip all the pointless design? LLVM? Android DEX? Java Class or C# IL formats aren't enough?

Because the major browser devs that designed WebAssembly are not smart enough to have thought this

/s

Re:Why WebAssembly Is Faster Than Asm.js by fmap on Thursday March 16, 2017 @11:05AM (#13885561)
As others have already pointed out, this has been tried before. Turns out that some people are opposed to shipping LLVM with the browser, or any other large existing codebase.

The reality is that WASM has to target the existing JavaScript backends in every popular browser. And now you can't use LLVM, because the backends in question typically only handle reducible control flow, etc. Conversion from LLVM to a form that your JavaScript backend supports is relatively expensive and not something you want to do on every load.

Re:Why WebAssembly Is Faster Than Asm.js by rocqua on Thursday March 16, 2017 @05:49AM (#13883748)
We had Java in the browser for a while.

It sucked.