Hacker News new | ask | show | jobs
by lewisjoe 871 days ago
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 capabilities (grapheme splitting, sentence splitting, core algorithms, etc)

3. Google Docs (word processor) uses WASM for offline proofing

These are just examples. If you look at the pattern the transition isn't happening in a way that all softwares are entirely targetted for webassembly. It's happening in little steps leveraging webassembly to parts of the product where it makes sense. This I believe is how the transition should be as opposed to jumping all the way to webassembly just because it's shiny.

2 comments

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.

How large is WASM? and how convoluted are the implementations and the integrations now?
Ballparking it based on the relative LOC of v8/src and v8/src/wasm, about 8%. That's for everything WASM though, not just the SIMD support, and it's a fully optimized and production-ready implementation.
JS being abused as a compilation target is definitely not a long-term strategy for the web. Going forward we need less emphasis on JS and more on HTML and WASM.
I'd like even more emphasis on JS, personally.
> Of course, without WASM, we'd be missing out on lots of cool software that was previously stuck on desktop/native.

Maybe not. Someone could have written a backend for GCC and/or LLVM that targets JS in the same way that Emscripten targets WASM (with JS around the edges).

Is there a citation for 3?

Afaik, WASM is only used by Sheets [1].

[1]: https://2024.wasmio.tech/sessions/webassembly-at-google/

No there's no announcements yet for #3. But if you look around their code you'll find wasm files for spellchecking/proofing and associated models for select few languages.

Combined with the fact that google docs support proofing for those languages offline, it's easy to guess how they achieved it.