-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WASI API considerations #91
Comments
Thanks for the link! Some parts of Drawbridge operate at a different level of abstraction, for example:
The reason we didn't approach WASI at this level is that the core WebAssembly platform with linear memory is already at a higher level; some of the issues are described here. Some parts look somewhat similar to APIs in WASI:
although I wasn't able to find detailed documentation on how these and other APIs work. Drawbridge also appears to offer process checkpointing with serialization, which is useful functionality that WASI may want to consider. The paper says "our library OS leverages I/O streams to emulate NT file objects and named pipe objects, as well as a proxied interface to networking sockets." There's unfortunately not a lot of detail here, but we have looked at other systems that do similar things, and I can offer some general thoughts: The paper doesn't have a lot of detail, so I'm making some assumptions here; please feel welcome to correct me if I'm getting something wrong. What the above seems to imply is that Drawbridge in fact does have fairly complex and possibly Windows-specific APIs, which aren't reflected in the absolute number of system calls, because they're being proxied over stream APIs. In general, I believe WebAssembly pushes us away from APIs that serialize structured data or complex APIs into streams, at least when communicating between WebAssembly modules. This is because WebAssembly has other ways to do this -- modules can just call each other, both ways, directly. While this does mean that the number of system calls might end up higher than it might otherwise be, it doesn't mean that the system has more features or is more complex. In some ways, this simplifies the system because it takes better advantage of WebAssembly's static type checking. If there are other specific ideas from Drawbridge you think are worth considering, please highlight them! |
Yes, checkpointing is an interesting feature (security, deployment, ...). There might be also some more information about the use of the "streaming API" in these places:
Apart from Drawbridge I have some concerns e. g. about the tree-based filesystem-like API (see WebAssembly/WASI#1 (comment) ) and in general about the "too rigid, almost archaic" perception of logical data chunks with serialized data usually called files. The concept of a file might be defined similarly to the following tuple.
Note I believe WASI shall abstract over this to simplify things and allow for more straightforward (more efficient) use of the actual data. As a side note - actually I think there is nothing like a file, but rather just a pair of separate chunks of data: |
Discussion continues at WebAssembly/WASI#28. |
* Begin sketching out a new high-level `fs` API. This is a very preliminary sketch of #83. It doesn't even compile yet, but it shows a possible high-level structure of such an API. * Stub out more functionality. * Switch from a lazy_static WasiCtx to a borrowed one. * Reformat some comments. * Code-quote `Self`. * Implement error translation for Windows. * Calls to `fd_close` are now unsafe. * Implement a few more functions.
This allows zero-copy access to the linear memory.
Fixes bytecodealliance#89. Signed-off-by: Stephan Renatus <[email protected]>
* Rebase on the new wasi-sockets. This switches to using the wasi-sockets wit files from WebAssembly/wasi-sockets#16. Many things are still stubbed out with `todo!()` for now. * Fix compilation on Windows.
* Rebase on the new wasi-sockets. This switches to using the wasi-sockets wit files from WebAssembly/wasi-sockets#16. Many things are still stubbed out with `todo!()` for now. * Fix compilation on Windows.
Switch to 64bit proverjs
This patch adds a basic stack pooling allocator for WasmFX stacks. It is gated behind a feature flag `wasmfx_pooling_allocator`, which is disabled by default. By default stacks are safe, meaning they have a page guard attached. The old unsafe stacks are gated behind the feature flag `unsafe_wasmfx_stacks`. In addition, this patch also adds missing WasmFX features to `wasmtime-c-api` and `wasmtime-c-api-impl`. Resolves bytecodealliance#91. Resolves bytecodealliance#26.
After looking quickly at the API, I came to conclusion, that it seems to be slightly more unix/POSIX oriented than a really generic API. Maybe there is still time to do something about it 😉.
The text was updated successfully, but these errors were encountered: