-
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
Too many syscalls in wasi? #87
Comments
I agree about Concerning "everything is a file" more broadly, there are two sides to it, which in WASI terms translate to: "should every capability be initiated through Should every capability be initiated through
|
I've noticed in a different thread @npmccallum requested more of the socket interface to be exposed as system calls, so the runtime they are working on might not need a path interface not because they only need file descriptors, but because the applications they foresee running on it don't need to open files or directories on the host system. Making access to the network available through path may affect @npmccallum's requirements. A more elegant approach, I think, is to let each wasi application have a root namespace through which services (that use standardized names) would be made available to it and to embed a manifest that would indicate to the runtime which services the application expects. I don't know how many hoops the runtime would need to jump to do this, however, and if it's worth it in the end, unfortunately. |
@eugene2k If you look at #74 , my preference is actually to have a more modular approach. One alternative could be to encapsulate filesystem (including |
I tried experimenting with the "everything is a file" model in my ABI designs and ended up switching to separate wasm modules for each concern. This makes statically analyzing the syscall requirements of a wasm binary very straightforward. With a file-based interface it makes syscall resolution a runtime error. This can be solved with additional tooling and custom sections but it seems to be redoing what the wasm module system already has in place. |
After a bit of deliberation, I have to agree: the modular wasi approach seems like the way to go. My initial concern was that wasi will end up growing more and more because the more people use wasi the more use cases they will have and the more interfaces they will want standardized, until, eventually, wasi ends up with a .NET/CLR of its own. My reasoning was that if wasi offered these interfaces through an IPC mechanism, the runtime wouldn't have to get bloated. However, if the host doesn't follow "everything is a file" philosophy, the runtime will get bloated anyway and, sadly, the world doesn't follow this philosophy. Thanks for your time and answers, everyone! |
Sounds good. One additional thing I want to mention here is that WASI APIs don't need to be implemented in the wasm runtime. They're just wasm imports, and so could just as well be implemented by other regular wasm modules. This is actually another reason why modularization as @npmccallum suggests will be useful. Closing this issue as the original question is answered, but feel free to open new issues if there are any followup questions or ideas! |
* Preserve signalling bit in NaNs * Fix warnings
`readlink -f` is not existing in macOS, so this commit uses another way to get an absolute path for wasmtime build directory. Fixes bytecodealliance#87
…ode/update-wasi Update wasi-filesystem, wasi-clocks, wasi-io, and wasi-poll.
…ode/update-wasi Update wasi-filesystem, wasi-clocks, wasi-io, and wasi-poll.
Rename test-zk-64.sh -> test-zkasm.sh
Notable changes: * Use recent wasm(fx)-tools release. * Rename `WasmType` to `WasmValType`. Also, this patch disables CI checks for unsupported platforms.
I'm a big fan of Plan9 and its short list of system calls. Is there any reason why wasi has more system calls than Plan9? It seems redundant to have system calls for things that could be made available through the virtual filesystem, such as environment variables and rng as well as syscalls like
sock_send
andsock_recv
that basically duplicatewrite
andread
The text was updated successfully, but these errors were encountered: