Live data from Hacker News

WebAssembly Playground

observablehq.com

61–70 of 99 posts

Re: WebAssembly Playground

#61

Question from someone knew very little in this domain: what stops mass adoption of WebAssembly? A few years ago, I used a WASM demo website which can use a WASM version of ffmpeg to mux audio and video into a file (transcoding obviously wasn't practical, at least not at that time), and I was very impressed. I can see lots of potential of it. But I still haven't see much usage of it even today. (To be totally honest -…

> Question from someone knew very little in this domain: what stops mass adoption of WebAssembly?

I think it's the focus on native apps. There's isn't exactly a benefit of WASM when you have a native app.

I was kinda hoping all the complaints about app stores would push people back to web apps and then I think you'd see a surgence of WASM. I guess Apple/Google gives apps too much tracking ability on native apps compared to web apps to make it worth it to re-do the app thrice (Android/iOS/Web Desktop) instead of just twice (Mobile Web/ Desktop Web).

Re: WebAssembly Playground

#62
post #47

Earlier quoted context omitted.

It's possible. See https://github.com/thi-ng/umbrella/tree/develop/packages/was... for example.

Not really. From that very page: "Since only numeric values can be exchanged between the WASM module and the JS host, any JS native objects the WASM side might want to be working with must be managed manually in JS. "

That's out of date. You can share GC managed references between host and guest now. Here's an example of Scheme compiled to Wasm that uses DOM APIs: https://spritely.institute/news/building-interactive-web-pag...

Re: WebAssembly Playground

#63

Question from someone knew very little in this domain: what stops mass adoption of WebAssembly? A few years ago, I used a WASM demo website which can use a WASM version of ffmpeg to mux audio and video into a file (transcoding obviously wasn't practical, at least not at that time), and I was very impressed. I can see lots of potential of it. But I still haven't see much usage of it even today. (To be totally honest -…

From my perspective It's 2 primary blockers. 1. It's too damn hard to get data into and out of wasm modules. The component model is addressing this but it's sprawled out into literally rebuilding "worlds" and turning wasm modules into sort of lightweight virtual machines. I wish there was just more of a focus on getting data into and out of modules first. 2. Lack of GC which has made languages like js/python/jvm/c# u…

Yeah, I think the GC bit was one of the huge missing pieces for dynamic languages on Wasm. Things seem to be moving very quickly now that Wasm GC is out there: https://spritely.institute/news/building-interactive-web-pag...

Re: WebAssembly Playground

#64

Question from someone knew very little in this domain: what stops mass adoption of WebAssembly? A few years ago, I used a WASM demo website which can use a WASM version of ffmpeg to mux audio and video into a file (transcoding obviously wasn't practical, at least not at that time), and I was very impressed. I can see lots of potential of it. But I still haven't see much usage of it even today. (To be totally honest -…

From my perspective It's 2 primary blockers. 1. It's too damn hard to get data into and out of wasm modules. The component model is addressing this but it's sprawled out into literally rebuilding "worlds" and turning wasm modules into sort of lightweight virtual machines. I wish there was just more of a focus on getting data into and out of modules first. 2. Lack of GC which has made languages like js/python/jvm/c# u…

> Lack of GC which has made languages like js/python/jvm/c# unfeasible.

I've had success running F# (a .NET language, like C#) on WASM using Bolero: https://fsbolero.io

Re: WebAssembly Playground

#65
post #55

Earlier quoted context omitted.

I'm developing a wasm game, and currently I am targeting WebGL2 in order to run in iOS Safari. Me (and others, I'm sure) are currently waiting for WebGPU [1] to land in Safari so it will make sense to target it. WebGPU allows for simplified porting of desktop games to the web, such as WGSL shaders [2] WebGPU will be the next big thing [3], and currently it is enabled on Chrome Windows/macOS, and can be enabled in Fir…

8MB seems high for Rust. Even the project I did [1] which was using D (with GC) ended up with an 8MB WASM. Rust's WASM target is much more exercised than D's, so I think you might need to tweak some compile options. [1] https://github.com/speps/tt

That's possible. I did spend quite a bit of time tinkering with compiler flags and followed the recommendations, but there is many knobs.

For what it's worth I don't think 3MB is extremely large anymore, as several popular websites already weight in 2-3 MB for a full page loads.

Examples:

  * www.youtube.com = 3.3 MB
  * www.tiktok.com = 3.3 MB
  * www.instagram.com = 2.1 MB
(according to https://www.supermonitoring.com/p/page-speed)

That said, I would love to shave off more size off my wasm binaries :-)

Some notes I found just now seems to be in line with my results, though: https://github.com/bevyengine/bevy/issues/3978#issuecomment-...

Re: WebAssembly Playground

#66
post #23

Earlier quoted context omitted.

To incorporate something currently is only available in "native" program form is what I am thinking; like ffmpeg example above.

Which could have been done with WebAudio and WebGL/WebGPU as well, without the pain of dealing with WebAssembly tooling.

Do you mean those features added to WebAudio or that you could use WebAudio to implement those features, because the latter is not really true

Re: WebAssembly Playground

#67

Question from someone knew very little in this domain: what stops mass adoption of WebAssembly? A few years ago, I used a WASM demo website which can use a WASM version of ffmpeg to mux audio and video into a file (transcoding obviously wasn't practical, at least not at that time), and I was very impressed. I can see lots of potential of it. But I still haven't see much usage of it even today. (To be totally honest -…

Around a year ago I used the GHC WebAssembly backend to get some Haskell code running in the browser, but that needed WASI(WebAssembly System Interface) which was tricky to set up correctly. There were plenty of warnings about things being incomplete and experimental, and the code would crash unless I told it to do some pointless work during initialization (my best guess is that there was some bug involving the Haskell garbage collector and memory allocation - there are enough warning messages that I don't think "it's never a compiler bug" applies here).

Re: WebAssembly Playground

#68
post #52

Is the site working? There seem to be broken sections: a section that just says "undefined", a large section that's blank, and a section that just says "Error: process exited with code 1.".

You may need to wait for a while till the wasm file is loaded, and there is a chance that the disassembly or execution result is not shown. In that case, please try to run the code block again.

Re: WebAssembly Playground

#69

Earlier quoted context omitted.

By mass adoption, do you mean why not all existing softwares are ported to webassembly so that they can be run on browsers? Most websites are just that - "sites". Complicated softwares that _need_ to be run on the web are already leveraging WebAssembly to an extent. 1. Figma (Design tool) uses Webassembly underneath for graphics operations. 2. Zoho Writer (word processor) uses WebAssembly for leveraging ICU capabilit…

As far as I know Figma used asm.js (then WASM) from the start. I actually don't think they'd have had the success they had without it - it would have been too slow built in JS. So in a way webasm/asm.js is already allowing whole new categories of webapps we take for granted now.

I always wonder how much faster JS could be if the effort that went into WASM went into JS. ASM.js, SIMD, snapshots, etc directly in JS could have really made it a serious contender for high-performance software.

Of course, without WASM, we'd be missing out on lots of cool software that was previously stuck on desktop/native. But I'm not entirely convinced it was the right path.

Re: WebAssembly Playground

#70

Earlier quoted context omitted.

As far as I know Figma used asm.js (then WASM) from the start. I actually don't think they'd have had the success they had without it - it would have been too slow built in JS. So in a way webasm/asm.js is already allowing whole new categories of webapps we take for granted now.

I always wonder how much faster JS could be if the effort that went into WASM went into JS. ASM.js, SIMD, snapshots, etc directly in JS could have really made it a serious contender for high-performance software. Of course, without WASM, we'd be missing out on lots of cool software that was previously stuck on desktop/native. But I'm not entirely convinced it was the right path.

They did try to do SIMD in JS, and the proposal made it as far as being implemented in browsers, but it ended up being hideously convoluted in practice so it was killed in favor of WASM SIMD.

The MVP implementation of SIMD.js grew to about 10% of V8s entire codebase, just for the bare minimum "it runs" support without optimisations.

Post reply on HN