Skip to content

Conversation

@alexcrichton
Copy link
Member

This commit enhances wit-component's import detection to support "unit" future and stream types which don't have a payload in a special way. Previously it was required that these types were mentioned in some WIT somewhere to get connected to a function, but now it's possible to import these intrinsics directly even if the type isn't mentioned in WIT.

The motivation for this change is to support guest language async runtimes which are world-agnostic to still operate on unit futures/streams as necessary without binding them to any particular WIT import or export. For example it's expected that unit streams are a primitive for inter-task communication in the component model.

This commit enhances `wit-component`'s import detection to support
"unit" `future` and `stream` types which don't have a payload in a
special way. Previously it was required that these types were mentioned
in some WIT somewhere to get connected to a function, but now it's
possible to import these intrinsics directly even if the type isn't
mentioned in WIT.

The motivation for this change is to support guest language async
runtimes which are world-agnostic to still operate on unit
futures/streams as necessary without binding them to any particular WIT
import or export. For example it's expected that unit streams are a
primitive for inter-task communication in the component model.
@alexcrichton alexcrichton requested a review from dicej November 25, 2025 05:07
@alexcrichton alexcrichton requested a review from a team as a code owner November 25, 2025 05:07
Co-authored-by: Joel Dice <joel.dice@fermyon.com>
@alexcrichton alexcrichton added this pull request to the merge queue Nov 25, 2025
Merged via the queue into bytecodealliance:main with commit 145be84 Nov 25, 2025
34 checks passed
@alexcrichton alexcrichton deleted the unit-futures-and-streams branch November 25, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants