News for hackers. Stuff that matters.
Re:WebAssembly: Mozilla Won by TazeTSchnitzel on Thursday June 01, 2017 @07:30AM (#14459407)
To the extent that asm.js and JavaScript are, yes. Everything is well-defined, so in theory any Turing machine should be able to run it, but it's certainly going to be easier to implement efficiently on a typical modern 32-bit or 64-bit CPU in a computer or phone than on something more unusual.
Re:WebAssembly: Mozilla Won by k__ on Thursday June 01, 2017 @07:53AM (#14459487)
So I could write an application in, lets say Rust, compile it to WASM and run it on Linux, macOS and Windows browsers without anything extra?
Re:WebAssembly: Mozilla Won by TazeTSchnitzel on Thursday June 01, 2017 @08:09AM (#14459575)
Yep! It's a completely portable target and fulfils the promise of “compile once, run anywhere”, although how well it runs depends on the particular browser.

(It is pretty amazing you can compile C code to something that actually runs on multiple machines, it's very nice.)

Re:WebAssembly: Mozilla Won by k__ on Thursday June 01, 2017 @10:14AM (#14460374)
Yes, this sounds awesome.

Can this be used as alternative to native modules in Node.js?

Re:WebAssembly: Mozilla Won by bobbytherobot on Thursday June 01, 2017 @11:18AM (#14460962)
That is a good question. I imagine it depends on why it is a native module. If they are native module because it utilizing features at the OS or machine level, then I doubt they could.
Re:WebAssembly: Mozilla Won by TazeTSchnitzel on Thursday June 01, 2017 @12:09PM (#14461523)
Well, whatever syscalls you want to make could be made by node.js for you, though that quickly veers into absurdist territory.
Re:WebAssembly: Mozilla Won by markdog12 on Thursday June 01, 2017 @12:10PM (#14461546)
Yes, search for remcob's answer on this page
Re:WebAssembly: Mozilla Won by jonloldrup on Thursday June 01, 2017 @08:03AM (#14459540)
yes, but the API you'll code against is limited
Re:WebAssembly: Mozilla Won by roca on Thursday June 01, 2017 @08:09AM (#14459576)
That's not really true. With JS glue code (including many libraries already written) Wasm modules can access anything JS can do. E.g. there are Wasm demos showing access to WebGL2, audio generation, camera/microphone, HTTP, storage, gamepads, ...
Re:WebAssembly: Mozilla Won by camus2 on Thursday June 01, 2017 @09:16AM (#14459956)
> E.g. there are Wasm demos showing access to WebGL2, audio generation, camera/microphone, HTTP, storage, gamepads, ...

All web API. nothing a Javascript app in the browser can't do.

Re:WebAssembly: Mozilla Won by livingparadox on Thursday June 01, 2017 @12:48PM (#14461946)
That's the point. a WASM app has access to the same Web APIs that JS does, for the most part. This was in response to the claim that WASM only gets to work off of a limited api, not an argument as to why WASM is an improvement over JS.
Re:WebAssembly: Mozilla Won by TremendousJudge on Thursday June 01, 2017 @11:57AM (#14461390)
>nothing a Javascript app in the browser can't do.

not being written in Javascript is a great advantage

Re:WebAssembly: Mozilla Won by TazeTSchnitzel on Thursday June 01, 2017 @08:22AM (#14459639)
You have the full Web API, yes, but it's limited compared to native, although sure, it's nonetheless very capable.
Re:WebAssembly: Mozilla Won by dtzur on Thursday June 01, 2017 @08:03AM (#14459541)
Yes, that's the goal
Re:WebAssembly: Mozilla Won by kuon on Thursday June 01, 2017 @09:38AM (#14460098)
PowerPC and SPARC are still around and well, no? (haven't checked in a while, and I remembed something about PowerPC being able to switch endianess)
Re:WebAssembly: Mozilla Won by makomk on Thursday June 01, 2017 @09:18AM (#14459967)
Which is to say that they assume little-endian just like asm.js and modern JavaScript do. Architectures other than ARM and x86 are mostly dead so this isn't generally a huge problem except for the handful of die-hard Amiga users.