Skip to content

feat: add {stream,future}.forward canon builtins - #2614

Draft
rvolosatovs wants to merge 2 commits into
bytecodealliance:mainfrom
rvolosatovs:feat/stream-forward
Draft

feat: add {stream,future}.forward canon builtins#2614
rvolosatovs wants to merge 2 commits into
bytecodealliance:mainfrom
rvolosatovs:feat/stream-forward

Conversation

@rvolosatovs

@rvolosatovs rvolosatovs commented Aug 20, 2026

Copy link
Copy Markdown
Member

Add support for {stream,future}.forward builtins as specified in WebAssembly/component-model#709

@rvolosatovs rvolosatovs changed the title feat: add stream.forward canon builtin feat: add stream.splice canon builtin Aug 21, 2026
@rvolosatovs rvolosatovs changed the title feat: add stream.splice canon builtin feat: add stream.{splice,forward} canon builtins Aug 21, 2026
@rvolosatovs
rvolosatovs force-pushed the feat/stream-forward branch 2 times, most recently from 8ff9873 to 6ce0ba5 Compare August 24, 2026 15:19
@rvolosatovs rvolosatovs changed the title feat: add stream.{splice,forward} canon builtins feat: add {stream,future}.forward canon builtins Aug 24, 2026
Implement parsing, validation, encoding, and printing support for the
⏩-gated `stream.forward` built-in proposed in
WebAssembly/component-model#658:

    (canon stream.forward $streamT (core func $f))

where `$f` has type `(func (param i32 i32))`, taking a readable stream
end and a writable stream end.  `stream.forward` transfers both ends
out of the calling instance and returns immediately with no result, so
it takes neither an `n` parameter nor an `async` immediate.  It also
takes no `canonopt`s, since no elements pass through the caller's
linear memory.

The binary encoding uses opcode 0x2f as assigned in the proposed
specification change, and validation gates the built-in behind the
component model async and "more async builtins" features.

Assisted-by: claude:claude-fable-5
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Implement parsing, validation, encoding, and printing support for the
⏩-gated `future.forward` built-in proposed in
WebAssembly/component-model#658:

    (canon future.forward $futureT (core func $f))

where `$f` has type `(func (param i32 i32))`, taking a readable future
end and a writable future end.  Exactly like its `stream.forward`
counterpart, `future.forward` transfers both ends out of the calling
instance and returns immediately with no result, so it takes neither
an `async` immediate nor any `canonopt`s, since the value does not
pass through the caller's linear memory.

The binary encoding uses opcode 0x2e as assigned in the proposed
specification change, and validation gates the built-in behind the
component model async and "more async builtins" features.

Assisted-by: claude:claude-fable-5
rvolosatovs added a commit to rvolosatovs/wasmtime that referenced this pull request Aug 25, 2026
Pick up `wasmparser`/`wast`/`wasm-encoder` support for the
`stream.forward` and `future.forward` canonical built-ins from
bytecodealliance/wasm-tools#2614 until that
lands upstream.
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.

1 participant