4 ms·
Why use a WASM VM when there are more mature VMs out there like .net/CLR? What's the benefit?
by rafale 4y ago
Why use a WASM VM when there are more mature VMs out there like .net/CLR? What's the benefit?
- juntao 4y agoI can think of a few: * Lightweight (no GC, under 2MB) * Designed to be a secure sandbox (not just a language runtime) * Modular (add host functions as needed — eg support for Tensorflow) * Multiple languages (esp compiled languages like Rust) * Works with container tools (Docker, k8s etc)
- pjmlp 4y agoLightweight (no GC, under 2MB) => Which is why all GC based languages are forced to bring their own GC when targeting WASM. Designed to be a secure sandbox (not just a language runtime) => JVM and CLR also were designed as such. It didn't work out as well as planned, when black hat hackers started researching how to game the sandbox. Still open for WASM. Modular (add host functions as needed — eg support for Tensorflow) => JVM and CLR have dynamic code loading capabilities. WASM still hasn't standardized dynamic linking => Multiple languages (esp compiled languages like Rust) => Just like CLR, hence why it is Common Language Runtime, C and C++ were part of version 1.0 release. Works with container tools (Docker, k8s etc) => Just like JVM and CLR do.
- Deukhoofd 4y agoIt's ideal for running untrusted code, as it will only be able to access the external functions it's given by the host. This in contrast with other VMs, where you're effectively giving full system access to the VM. Besides that, WASM allows for an open universal standard for VMs. This means that we can easily develop with many different languages for WASM.