Live data from Hacker News

WebAssembly support now shipping in all major browsers

blog.mozilla.org

81–90 of 346 posts

Re: WebAssembly support now shipping in all major browsers

#81
post #41
post #39

Earlier quoted context omitted.

Expect every language out there to have a WebAssembly implementation, including Flash.

Until wasm supports proper tail calls, only the ones with uninteresting control structures.

There is a proposal, though it's taken some work due to ABI issues. My understanding is that it's fairly close though.

Re: WebAssembly support now shipping in all major browsers

#82
post #11
post #6

Earlier quoted context omitted.

In order to port other languages (Haskell, Go, Python) to target WASM, we definitely need the possibility of writing a GC in WASM. But to build an efficient GC, we need multithreading and synchronization/memory barrier primitives.

Multi threading brings in all kinds of security issues

But without multithreading, you can use 1/4th or 1/8th of the computation power available on your average consumer device.

What kind of issues are you thinking about? Multithreading is not easy but your typical race conditions and multi threaded problems aren't really opening doors to any new security exploits.

Browsers and WASM have quite decent sandboxing to mitigate security issues. There's WebWorkers already which brings a limited form of threads to the browser.

I'm not seeing a problem with multiple threads in a browser.

Re: WebAssembly support now shipping in all major browsers

#83

did they improve external stacktrace support? the last time I checked debugging was imposible due to bad stacktraces.

My understanding is that the current debugging tools can show you the text format of wasm, but showing the original code you compiled to wasm doesn't work quite yet. It's under discussion.

Re: WebAssembly support now shipping in all major browsers

#84
post #58

How do I compile/target stuff for WebAssembly and integrate it with "usual web" (I need to use some advanced math & WebGL real-time that is too slow in JS)? Is there any good tutorial? Thanks!

The "awesome wasm" link collection has many good starting points: https://github.com/mbasso/awesome-wasm

Re: WebAssembly support now shipping in all major browsers

#85
post #20

Earlier quoted context omitted.

But what is a computer for if not running other people's code? I can't imagine there are many people in this world who have a computer with more than even 1% their own code running on it.

Red herring. People install or explicitly download code they want to run. The general public doesn't even realize that most web pages are full of code (js not html) and most developers have gotten so used to it they feel entitled. The goal should be to try harder to use less code, not enable native execution. I understand, engineers like to think about what is possible (wouldn't it be cool if..!) but sometime they ne…

> The goal should be to try harder to use less code

The goal is to deliver content and experiences that people actually want, it has nothing to do with the amount of code at all.

At best, using less code might be a performance optimisation (though not always).

Re: WebAssembly support now shipping in all major browsers

#86
post #64

Unfortunately SIMD is still not supported on any browsers and with the move away from SIMD.js it looks like this might take a while. We've been working on porting over our fairly large barcode scanner library to WebAssembly. While the performance is close to what we have on other platforms ( http://websdk.scandit.com ), the major bottleneck for now is not being able to use optimized code relying on SIMD (and not havi…

SIMD is like the kids version of GLSL, which works today :)

Running anything with the GPU introduces a huge amount of latency, it only makes sense when you need high throughput and have large enough workloads to justify the latency. SIMD code can be interleaved with normal native code with zero latency.

And then there's the fact that WebGL is so much behind the state of the art that it's not even funny. Sticking to an old version of GL/GLSL severely limits what you can do with it.

Re: WebAssembly support now shipping in all major browsers

#87
post #68

Can anybody ELI5? The documentation is pretty fluffy. Does WebAssembly actually open up any new API hooks? I get that its a clever way of transpiling existing programs to JavasScript, but surely we could do that already? Whats new avenues of development is WebAssembly expected to open up? Is the whole point just to enable an easy way to compile games made on other platforms (Unity) to the web?

Today the browsers virtual machines can work only with Javascript code. That means that if you want to use another language you have to convert in to Javascript, and you are obviously limited by the features of Javascript. The goal of WASM is to provide a language similar to Assembly (or bytecode of Java) that can be understood by the virtual machines of browser, and so to have a new way to compile languages and use them in the browsers. WASM can also be optimized better, having more features than Javascript (for example javascript uses only double as number types, while WASM has integers and floats)

Re: WebAssembly support now shipping in all major browsers

#88
post #75
post #68

Can anybody ELI5? The documentation is pretty fluffy. Does WebAssembly actually open up any new API hooks? I get that its a clever way of transpiling existing programs to JavasScript, but surely we could do that already? Whats new avenues of development is WebAssembly expected to open up? Is the whole point just to enable an easy way to compile games made on other platforms (Unity) to the web?

WASM is used to run native code in the Web browser without going through JavaScript. With it, it should be possible to run code at near-native performance in the browser. WASM is an intermediate representation which is output by your compiler (of your favorite language) and consumed by the browser's compiler to emit native code. WASM is a bit similar to LLVM IR, but it's architecture independent. Compare this to, say…

Oh I see- that makes sense.

Re: WebAssembly support now shipping in all major browsers

#89
post #68

Can anybody ELI5? The documentation is pretty fluffy. Does WebAssembly actually open up any new API hooks? I get that its a clever way of transpiling existing programs to JavasScript, but surely we could do that already? Whats new avenues of development is WebAssembly expected to open up? Is the whole point just to enable an easy way to compile games made on other platforms (Unity) to the web?

WebAssembly is (currently) the same as asm.js, but with smaller file size and faster parse times. Asm.js is just a subset of JavaScript that can be optimized because it doesn't use certain features (like strings or garbage collection).

WebAssembly and asm.js are both intended to be compile targets - you don't write them by hand, but instead write your code in another language (c, Rust, etc.) and then complie to them.

The main benefits are 1) JavaScript is no longer the only language of the web, and 2) it's possible to get better performance than JS ever allowed for.

There is a lot of c code out there that probably isn't worth rewriting fron scratch in JS, but may well be worth recompiling to run as a web app.

Also, in the future, WebAssembly should get DOM access, optional garbage collection and other features that will allow it to be a compile targets for other languages such as Python and Ruby. So then you can use a single language for all of your development without that language being JavaScript.

Re: WebAssembly support now shipping in all major browsers

#90
post #75
post #68

Can anybody ELI5? The documentation is pretty fluffy. Does WebAssembly actually open up any new API hooks? I get that its a clever way of transpiling existing programs to JavasScript, but surely we could do that already? Whats new avenues of development is WebAssembly expected to open up? Is the whole point just to enable an easy way to compile games made on other platforms (Unity) to the web?

WASM is used to run native code in the Web browser without going through JavaScript. With it, it should be possible to run code at near-native performance in the browser. WASM is an intermediate representation which is output by your compiler (of your favorite language) and consumed by the browser's compiler to emit native code. WASM is a bit similar to LLVM IR, but it's architecture independent. Compare this to, say…

But is this how it is implemented by actual browsers? if memory serves v8 is pretty much reusing most of JS VM for WASM?
Post reply on HN