Live data from Hacker News

Ask HN: What are the use cases of WASM outside the browser?

news.ycombinator.com

11–20 of 27 posts

Re: Ask HN: What are the use cases of WASM outside the browser?

#11
I personally think that WASM images will eventually displace (or merge with?) OCI images in server-side use cases. It remains to be seen if this will happen by the current OCI-focused stuff (Kubernetes mainly) adding capability for WASM apps or the WASM ecosystem developing its own parallel tooling of the same type (somebody coming up with "Kubernetes for WASM"). I think the latter has the possibility of being much cleaner, but there is a lot of momentum behind the former.

Re: Ask HN: What are the use cases of WASM outside the browser?

#13
post #2

Maybe a runtime for application plugins? You expose some apis in the wasm runtime and plug-in developers only have to target the wasm runtime.

Perfect use case. Any sort of script can be loaded into these app sandboxes for running with controlled access to everything external.

Re: Ask HN: What are the use cases of WASM outside the browser?

#15
The "running WASM on the server" use case is pretty fun and applies to whenever you want to execute untrusted user code and limit its capabilities / resources, e.g. for plugins. For example, we use it in Seafowl [1] for user-defined functions, so does ScyllaDB [2]. Cloudflare Workers [3] lets you deploy arbitrary WASM code at the edge and pay at high granularities just for the amount of time your function spends executing (e.g. 10ms is the limit for the free tier).

In addition, you can limit the amount of instructions [4] a certain subroutine is allowed to use up before halting.

Also, WASM subroutines can only call out to functions (including system calls) that you allow them to (they're sandboxed otherwise). By default, they can't open files / print to stdout, unless the module can import the relevant functions (which WASI [5] provides).

[1] https://www.splitgraph.com/docs/seafowl/guides/custom-udf-wa...

[2] https://www.scylladb.com/2022/04/14/wasmtime/

[3] https://blog.cloudflare.com/announcing-wasi-on-workers/

[4] https://docs.wasmtime.dev/api/wasmtime/trait.ResourceLimiter...

[5] https://wasi.dev/

Re: Ask HN: What are the use cases of WASM outside the browser?

#16

Coupled with WebGPU it might become the cleanest cross-platform/language abstraction to GPU programming.

That would be nice, but WASM and likely WebGPU is too far behind the state of the art of GPUs to be useful in such situations today. NVidia only implements CUDA AFAIK themselves.

Re: Ask HN: What are the use cases of WASM outside the browser?

#17

The "running WASM on the server" use case is pretty fun and applies to whenever you want to execute untrusted user code and limit its capabilities / resources, e.g. for plugins. For example, we use it in Seafowl [1] for user-defined functions, so does ScyllaDB [2]. Cloudflare Workers [3] lets you deploy arbitrary WASM code at the edge and pay at high granularities just for the amount of time your function spends exec…

Shameless plug: https://wasmer.io

Re: Ask HN: What are the use cases of WASM outside the browser?

#18

It's the rebirth of Java without the drawback of necessarily needing a runtime; write once in whatever (supported) language and run everywhere, if other platforms like OSes embrace the standard. The closest thing I've found is Flutter but that's only in Dart. Another use case, imagine a single program mixing and matching many different languages because they all compile up WASM as a universal format. This already hap…

Or more like CLR/.NET (and even Java/JVM with the proliferation of JVM languages) where you've got a bunch of languages targetting the same VM.

Re: Ask HN: What are the use cases of WASM outside the browser?

#20
The use case is exactly the same as running code inside a Virtual Machine... to run untrusted (and untrustable) code, yet limit its side effects to a clearly defined extent.

It provides capability based security, something Windows, Linux, etc. all lack.

Post reply on HN