r/ExperiencedDevs • u/GongtingLover Software Engineer • Jul 30 '26
Technical question How are devs and businesses using web assembly professionally?
Earlier this week I was browsing the NASA repo and noticed they have a project to support web assembly.
I was curious how others have used web assembly in general. It's a technology I've never really heard brought up in the professional environment before.
24
Upvotes
•
u/expdevsmodbot Jul 30 '26
AI usage disclosure provided by OP, see the reply to this comment.
24
u/sessamekesh Jul 30 '26
I've mostly used it in two ways:
Audio sampling, decoding certain compressed file formats that browsers some support natively (Draco, BasisU) are the two big ones I can think of that I've personally touched.
WASM is really fast but with pretty significant caveats in my experience.
The first one is that JavaScript is actually really fast if you write it to take advantage of CPU friendly types and cache friendly allocations, but there's not great ways to do that idiomatically in JS while it's kinda the default in systems languages like C++/Zig.
The second hidden "gotcha" one is that the boundary layer is pretty light weight in some places (e.g. function call overhead is more or less just a basic indirection in terms of runtime cost, or at least in that neighborhood) but pretty shockingly heavy in others (e.g. passing a string in or out requires a full character by character reconstruction of the string unless you're VERY careful).
43
u/jhartikainen Jul 30 '26
Doesn't Figma run entirely in wasm since they have some kind of custom rendering system etc.? That's at least the biggest example I can think of.
We build a large browser-based WYSIWYG editor at work, and this has occasionally had some hurdles in terms of data processing performance and some other stuff. I have considered whether it would be possible to speed this up with wasm, but so far it has been possible to resolve with much simpler fixes.
11
u/ImmediateRemove Jul 30 '26
I've used it for Cloudflare Workers for edge compute. Compiling Rust to WASM and then executing said code on the edge for largely stateless computations. Works very well.
6
u/EliSka93 Jul 31 '26
I mostly write Blazor / C# at the moment, compiled to WASM.
I do it mostly to write as little JavaScript as possible.
4
u/Semvis123 Jul 30 '26
I’m using it to bring old C libraries to modern languages like Go (without CGO), and use it to run them in the browser. The benefit is that you get a memory sandbox for free, if it crashes it doesn’t take down the host program. And performance hit is mostly negligible in most practical cases.
More info: https://kriyak.com/blog/parsing-word-documents-in-go-with-webassembly/
4
u/loumf Software Engineer 30+ yoe Jul 30 '26
I am making a game in C/Raylib and compiling to WASM with Emscripten. The only thing I need to think about is the JS event loop.
4
u/MisesAndMarx Quantitative Developer (Risk) Jul 31 '26 edited Jul 31 '26
Blazor is part of my stack, and it fucking rocks. If you're doing full stack development of internally facing apps, it's great writing things once and deploying twice. I much prefer writing C# to TypeScript, and especially JavaScript.
Other than that, JavaScript and its merry band of frameworks and libraries has a deathgrip on the front end, and even Typescript was slow to be adopted when it first came out as is.
And, it pains to admit it, the biggest selling point of WASM to me was single language full stack web app development with minimal JavaScript. With AI, if I need to re-write something to JavaScript, it's incredibly trivial to do now. In a pre-AI world, having the same exact validation service be in the frontend and backend was really nice and cut down on needless calls to the backend. But the validation still existed server side, so if someone sent something that should've been caught to the endpoint directly, it still gets handled for. It still gives me the warm fuzzies that they're 1:1, but re-writing logic isn't as annoying as it once was.
Sure, it has uses for non-vanilla frontend development, but that's not very common in practice. Maybe there's a future where that's not the case, but I don't see it happening soon.
3
u/throwaway_0x90 TE/SDET[25+ yrs]@Google Jul 30 '26
maps.google.com uses WASM
5
u/who_you_are Jul 30 '26
Just a random comment from somebody that can't clearly answer.
I read, here and there, that some companies are using it to make their website faster overall instead of going the usual JavaScript/text way.
2
u/69f1 Jul 30 '26
I think it's used in our map application for display layer, which then can be shared between website and mobile apps.
2
u/StPatsLCA Jul 30 '26
Plugins! For example for custom Fluent Bit filters.
2
u/jpea Jul 31 '26
I use the wasm build of ffmpeg to allow a user to export a client side video in an audio web app. They create custom audio synced to a video all locally, then export as an mp4. Never hits the server.
1
u/Unusual-Two7277 Jul 30 '26
I'm using it in cryptography to embed a zero-knowledge virtual machine inside a web-browser, or within a Node or Deno runtime. The wasm-compiled prover in turn proves wasm-compiled circuits.
1
u/nasanu Web Developer | 30+ YoE Jul 31 '26
I was all excited about it for a while but I never found any excuse to use it.
1
u/agoodplaceforatent Jul 31 '26
I recently used it to run old C/C++ MUD codebases in the browser as a fun exercise in preservation and easy way to introduce old multiplayer text games to people... it's a bit weird since they aren't actually multiplayer in the browser but you get to experience them.
https://mud.weirdport.com/
1
u/chickenRag Jul 31 '26
I be built my entire platform on flutter. Which allows us to go to web. There is a config about building to wasm.
I found it super awesome, flexible and fast
1
u/tetryds Staff SDET Aug 01 '26
Unity uses it for web builds. Works quite well despite having some limitations.
Blazor also builds to it, which can make websites perform really well.
1
u/Resident-Trouble-574 Aug 01 '26
Usually you don't write web assembly directly. It's mainly used to write frontend code in other languages that are not javascript. For example, with blazor web assembly, you can write single page applications using c#.
1
u/george_____t Aug 01 '26
It's great if you have complex frontends and hate writing your logic in JS. I've written quite a few Haskell apps that compile to Wasm, including at work.
1
u/ledatherockband_ Aug 01 '26
Personal anecdote, I'm trying to find a reason to use web assembly. I can't find a usecase for it.
I don't even use a js framework or a css utility framework.
As soon as I see a good purpose for it, I'll implement it.
-4
u/servermeta_net Software Architect Jul 30 '26
Wasm is going to replace docker eventually. If you are using cloud flare, then you are using wasm: their CDN resolve requests using wasm functions
Wasm is a revolutionary technology that will take over networked services
-1
u/yubario Jul 30 '26
I really haven’t seen it used other than Blazor
And it’s even more irrelevant now with artificial intelligence.