What are the use cases of WASM outside the browser?
What are the non obvious use cases of Wasm? Other than facilitate distribution and improve security, what do you think are the best potencial applications of wasm?
Ideally I'd like to be able to write desktop apps with the syntax of C but the performance of electron
Coupled with WebGPU it might become the cleanest cross-platform/language abstraction to GPU programming.
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.
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 happens in the frontend web with so called microfrontends which basically let you write various components in React, Vue, Angular etc and it all compiles down to JS.
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.
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.
I think a big use case is running kernels/UDFs directly inside databases or data infrastructure systems. For example, [0]. Imagine you need a custom function in postgres, but instead of implementing it in C and shipping a shared library, you would implement it in WASM.
[0] https://redpanda.com/blog/wasm-architecture
Multiplatform development, like compile once and run everywhere. Unfortunately, my understanding is that WASM is still lags behind native compilers in perf.
An OS built on top of WASM can provide modern features without the bloat of current CPUs, e.g. MMUs.
Application extensions/plugins
Edge computing/serverless
True polyglot environments (unlike Graal)
Really anywhere you want AOT/JIT compiled code running fast in a sandbox.
CosmWasm provides a smart contract execution layer for Cosmos application blockchains.