Skip to content

update future/stream ABIs and names #203

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

Merged
merged 1 commit into from
Jun 9, 2025
Merged

Conversation

dicej
Copy link
Collaborator

@dicej dicej commented Jun 9, 2025

This updates wasmtime-environ, wasmtime-cranelift, and wasmtime to to use (some of) the new ABI defined in
WebAssembly/component-model#524. It covers everything in that PR except the lifting and lowering changes to future.{read,write}, which we decided are more trouble than they're worth.

Still to do: add tests for the following items (Luke has volunteered to do this):

  • When a future is "done" (by a COMPLETED read/write or by the writable end receiving DROPPED), the only valid operation is future.drop-{readable,writable}. future.{read,write} or lifting traps.
  • Because there's no great reason for streams to be more permissive than futures in this regard, streams are also given a "done" state with the same trapping rules as futures, but the stream "done" state is only set when DROPPED is received.

This updates `wasmtime-environ`, `wasmtime-cranelift`, and `wasmtime` to to use
(some of) the new ABI defined in
WebAssembly/component-model#524.  It covers everything
in that PR _except_ the lifting and lowering changes to `future.{read,write}`,
which we decided are more trouble than they're worth.

Still to do: add tests for the following items (Luke has volunteered to do this):

> * When a `future` is "done" (by a `COMPLETED` read/write or by the writable end receiving `DROPPED`), the only valid operation is `future.drop-{readable,writable}`.  `future.{read,write}` or lifting traps.
> * Because there's no great reason for streams to be more permissive than futures in this regard, streams are also given a "done" state with the same trapping rules as futures, but the stream "done" state is only set when `DROPPED` is received.

Signed-off-by: Joel Dice <[email protected]>
@dicej dicej added this pull request to the merge queue Jun 9, 2025
Merged via the queue into main with commit adb7fbe Jun 9, 2025
44 checks passed
@dicej dicej deleted the dicej/future-and-stream-changes branch June 9, 2025 20:21
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