-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Status of WASI Core API #1434
Comments
With "WASI Core" in its current form, most Rust code should continue to use Rust's standard library interfaces for working with files and directories, rather than call into WASI directly. Our goal is to make most of the Rust standard library interfaces for files and directories just work, rather than requiring you to write new code specific to WASI. The Rust standard library and, for people that need it, the libc crate, deal with WASI directly so that you don't have to :-).
The libc crate's WASI module is similar to its fuchsia and cloudabi modules. If you're wondering why Rust's standard library uses libc for some things rather than always calling WASI directly, it's that WASI libc does more than a typical libc, such as special support for emulating absolute pathnames. Rust's standard library may eventually want to handle this itself, but for now, especially while WASI itself is still evolving, letting the libc handle such things makes it much easier to maintain. |
In my understanding WASI should not be Rust specific, so defining a platform as "here set of core functions, but actually they link to functions in an unstable module, so existing software can break tomorrow" seems a bit strange. If WASI target right now is intended to be purely experimental, then it's a different deal of course. My main motivation for those questions comes from work on
Aren't they link to libc for those platforms? While WASI module links to core platform functions (in a certain sense to syscalls)? For example Fuscia has In my opinion it would've been a bit more idiomatic to define Rust interface to WASI Core API in a separate crate (e.g. |
WASI itself is still evolving. We know that the current I agree that splitting out a |
Well, I think it will be easier and faster to change a smaller crate, than changing |
I guess you're right; we'd just need to add wasi-core as a dependency for libstd, but perhaps we can do that. I've now created https://github.com/CraneStation/wasi-core, which is published here to start experimenting with this. It has both a raw interface and the start of a slightly-more-idiomatic-Rust interface. Feedback welcome! I should also point out that there's work toward an IDL for WASI, which should eventually let us auto-generate more of this code, rather than maintaining it manually. |
Initially I've asked this questions relevant to
libc
here. I am not sure if i should ask them in WebAssembly/WASI repository, so I'll duplicate them here:libc
?libc
instead of a separate crate, likecloudabi
or Fuchsia crates? It's a bit strange to uselibc
for a target which, well, is not defined in terms of libc.cc @sunfishcode @alexcrichton
The text was updated successfully, but these errors were encountered: