Hacker News new | ask | show | jobs
by jedisct1 1044 days ago
https://wasix.org/docs may be what you are looking for.

The WASI section documents WASI as it is implemented today.

But since then, WASI pivoted and has become an umbrella for multiple projects. This is not just an API any more, and at the moment, the documentation on the WASI site and repositories is for WASI developers, not for developers using WASI. So if you didn't follow the whole thing, it is indeed be very hard to understand. The stack is complicated. But the ultimate goal of the project is to actually make it easier for developers to use wasm, without having to worry about all these details.

It's essentially about adding dynamic linking to wasm. The dynamic libraries embed the function prototypes, so that calling functions with the wrong type will cause a link error. That requires the definitions of every type of function, and WIT, WAI and WITX are domain-specific languages to do that.

Right now, WebAssembly is limited to static linking. It works very well, even across languages, but types aren't automatically checked. Actually, they are, but only using the primitive types available in WebAssembly. Here, the goal is to support something very close to the Rust type system.

The proposal also allows restricting every library to their own memory region. So, a buggy or malicious library can only mess with its own data, not with the rest of the application.

2 comments

A million times better. Looks like this comes from the Wasmer team.
Interesting. This seems almost like an object-oriented system where the objects can be large libraries written in different languages.

Do libraries have a lifecycle? Can you instantiate multiple instances of them?