Draft a prototype stdio design for wasip3.#75
Conversation
| /// This function reads at most `amount` bytes from a | ||
| /// “standard input” source. | ||
| @since(version = 0.3.0) | ||
| read: func(amount: u32) -> result<list<u8>, error>; |
There was a problem hiding this comment.
shouldn't this be async so you can avoid blocking?
There was a problem hiding this comment.
Async in Wit is just a hint, so you can avoid blocking either way, and the main question is what the default should be.
In my experience most programs that use stdin use it in a synchronous way, which suggests making it sync by default, but I don't have a strong opinion about it.
There was a problem hiding this comment.
many C programs use functions like kbhit or O_NONBLOCK on stdin, imo we should have support in the C library for stuff like that, afaict that requires the C library to use the async version even if most programs just block.
|
Thank you for contributing to WASI! As part of our proposal management process, we decided to consolidate all phase 3 proposals into a single monorepo at WebAssembly/wasi to better manage the proposals that have reached phase 3. We have completed migrating all phase 3 proposals to WebAssembly/wasi including their issues, but PRs need to be re-opened in the new repository. This is a GitHub limitation and we're sorry for the inconvenience. Please re-open this PR on WebAssembly/wasi. Thank you! |
There are still some FIXME comments in the code to resolve.