Advantages of using WebAssembly
WebAssembly (WASM) is a language without any runtime. Any kind of functionality – from allocating some memory to making an HTTP request – needs to be integrated by the consuming application. There are, however, some emerging standards such as the WebAssembly System Interface (WASI) that aim to bring a set of standard functionalities to any platform. This way, we can write platform-independent applications using WASM, with a runner integrating WASI.
WASI specification
The WASI specification covers everything that is needed to run WASM outside of a browser. Popular WASM runtimes such as Wasmtime or Wasmer implement WASI to actually run WASM applications. WASI specifies how system resources can be accessed by WASM. As a result, besides having WASI implemented in the runtime, the executed WASM code also needs to know (and use) the API provided by WASI. More details can be found at https://wasi.dev/.