4 ms·
Not directly related to this thread, but I was recently unpleasantly surprised how under-defined and undocumented is WASI. I was looking into some detail of a
by shp0ngle 3y ago
Not directly related to this thread, but I was recently unpleasantly surprised how under-defined and undocumented is WASI.
I was looking into some detail of a WASI call and there is… basically nothing.
Also the latest version of the docs is called something like “snapshot3” or whatever. I thought “wait this is it? that’s the whole definition”? apparently it is.
edit: here. The actual latest definition is in "legacy/preview1". Yes that is the latest WASI definition.
https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md https://github.com/WebAssembly/WASI/blob/main/legacy/preview...
What do the inputs mean? How should it behave in some extreme conditions? Eh YOLO who knows. All implementation dependent.
This document is literally all there is. That's it, that's the WASI definition.
- yuri91 3y agoI agree. I implemented a subset of WASI, and the best resource was an autogenerated C header with function signatures and very terse comments, buried in the WASI SDK repo.
- martindevans 3y agoI'm also currently implementing a subset of WASI, would you mind sharing a link to that file?
- yuri91 3y agoActually, it was in wasi-libc: https://github.com/WebAssembly/wasi-libc/blob/main/libc-bottom-half/headers/public/wasi/api.h https://github.com/WebAssembly/wasi-libc/blob/main/libc-bott...
- sunfish 3y agoI work on WASI, and completely agree. A lot of things are not clearly documented right now, and we're working on fixing it.
- titzer 3y agoAs an implementer of WASI, I applaud this. Also, we are using wasi-testsuite and plan to contribute to it as Wizard finally has a full-time project for WASI.
- brabel 3y agoNobody is documenting anything because all that matters for people in this area is for existing C/C++/Rust code to run without modifications on WASM, which means whatever low level POSIX APIs they use is what WASI will support. A large number of software has been ported to run on WASM/WASI, and you can ask yourself how is that possible if WASI doesn't even have a formal API? Because the API is basically being reverse engineered.
- AnIdiotOnTheNet 3y agoSo the situation is even worse than I had predicted: https://news.ycombinator.com/item?id=19502801 https://news.ycombinator.com/item?id=19502801
- deleted 3y ago[deleted]
- syrusakbary 3y agoWe (Wasmer), and other community members, were already aware of this. Because of that, we tried to be as detailed as possible about the system calls. We might to define them further, but hopefully the WASIX docs are a good start! https://wasix.org/docs/api-reference https://wasix.org/docs/api-reference
- shp0ngle 3y agoOh that's great! I needed this one month ago, lol. ahhh actual definitions! https://wasix.org/docs/api-reference/wasi/fd_read https://wasix.org/docs/api-reference/wasi/fd_read