> finally, a run-anywhere platform? (what the JVM and .Net always wanted to be)
WebAssembly doesn’t include a system interface, i.e., any way to interact with the outside world, so it isn’t an apples-to-apples comparison.
WASI seems like it’s coming along nicely, but it has nowhere near the feature set of the JRE or .NET. Anything that even approaches that level of capability is going to run into the exact same bloat and platform compatibility problems that those runtimes did.
Sure, but your add-ons will need access to some of the world, which right now requires giving them access to all of WASI, as far as I know. There’s no permissions model. That’s worse than the JVM.
A game which uses WASM plugins for modding would define its own 'system interface', basically an extremely restricted API to only access moddable game features but not allow access to any 'operating system services'.
It's very similar to how games would use a restricted subset of Lua which can only call into scripting APIs provided by the game, but not use random Lua stdlib features (like reading/writing files).
e.g. the WASI 0.2 spec here mentions clocks, filesystem access, creating sockets, etc.
Lua is architected the same way - As host, you create a Lua VM with no I/O, and then the host decides which I/O interfaces the VM can or cannot see.
JRE and .NET are probably built the same way internally. The reason wasm is hyped more than VMs with a decade of momentum behind them is that wasm is lower-level, it isn't tied to any particular GC model, and there's already backends for popular low-level languages like C, C++, Rust, and Go to compile into wasm modules.
"The Amsterdam Compiler Kit (ACK) is a retargetable compiler suite and toolchain written by Andrew Tanenbaum and Ceriel Jacobs, since 2005 maintained by David Given.[1] It has frontends for the following programming languages: C, Pascal, Modula-2, Occam, and BASIC."
"Maximum portability is achieved by using an intermediate language using bytecode, called EM. Each language front-end produces EM object files, which are then processed through several generic optimisers before being translated by a back-end into native machine code. "
"When IBM i was first released as OS/400, it was split into two layers, the hardware-dependent System Licensed Internal Code (SLIC)[15][1] and the hardware-independent Extended Control Program Facility (XPF).[16][8][33][34] These are divided by a hardware abstraction layer called the Technology Independent Machine Interface (TIMI). Later versions of the operating system gained additional layers, including an AIX compatibility layer named Portable Application Solutions Environment (originally known as the Private Address Space Environment),[5][35] and the Advanced 36 Machine environment which ran System/36 SSP applications in emulation.[1]"
> WebAssembly doesn’t include a system interface, i.e., any way to interact with the outside world, so it isn’t an apples-to-apples comparison.
For a plugin system this sort of isolation from the outside world is pretty much a hard requirement. You don't want random plugins to read/write/delete random files in your filesystem.
Because this idea has been done multiple times throughout the years with different kinds of bytecodes and VMs, since UNCOL in 1958, the WebAssembly folks just pretend they are always the first at something.
Yep, pretty sure that is what companies like Dylibso are working towards, making software into modules underpinned by plugins that are powered by WASM:
wasm is the perfect abstraction to build a -modular- and pluggable codebase (say grpc/proto as contracts) so you can just swap any part of it as long as the wasm module abides to such contract.
I keep going more and more to it when I try to design systems, in my mind at least, hoping I can put some to use
It could become a competitor for a lot of existing technologies. Some examples:
* embedded script languages (e.g.: Python in Blender and Gimp, Lua in games, VBScript in MS applications).
* add-on modules (e.g. COM on Microsoft platforms or COM-like for non-MS)
* finally, a run-anywhere platform? (what the JVM and .Net always wanted to be)