Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Draft a prototype stdio design for wasip3.#75

Closed
sunfishcode wants to merge 1 commit into
mainfrom
sunfishcode/stdio
Closed

Draft a prototype stdio design for wasip3.#75
sunfishcode wants to merge 1 commit into
mainfrom
sunfishcode/stdio

Conversation

@sunfishcode

Copy link
Copy Markdown
Member

There are still some FIXME comments in the code to resolve.

Comment thread wit-0.3.0-draft/stdio.wit
/// 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>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be async so you can avoid blocking?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@programmerjake programmerjake Jul 23, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ricochet

Copy link
Copy Markdown
Contributor

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!

@ricochet ricochet closed this Nov 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants