Skip to content

wit-parser: extend WasmImport for future/stream intrinsics#2454

Merged
alexcrichton merged 2 commits intobytecodealliance:mainfrom
peter-jerry-ye:zihang/extend-wasm-import
Mar 3, 2026
Merged

wit-parser: extend WasmImport for future/stream intrinsics#2454
alexcrichton merged 2 commits intobytecodealliance:mainfrom
peter-jerry-ye:zihang/extend-wasm-import

Conversation

@peter-jerry-ye
Copy link
Contributor

@peter-jerry-ye peter-jerry-ye commented Mar 3, 2026

Fixes #2409.

The intention is to hope that in wit-bindgen, we no longer need to concat strings to make up the name ourselves. And this hopefully can make the transition easier from the legacy naming to the standard32 naming.

Summary

  • Extend wit_parser::WasmImport with FutureIntrinsic and StreamIntrinsic variants.
  • Add FutureIntrinsic / StreamIntrinsic enums in wit-parser.
  • Implement Resolve::wasm_import_name support for these intrinsic imports under legacy mangling.
  • Keep Standard32 unsupported for future/stream intrinsics with an explicit message (current model is sync-only).
  • Refactor wit-component dummy module generation to keep declarative import templates while sourcing intrinsic names from resolve.wasm_import_name(...).

Validation

  • cargo clippy -p wit-parser --all-targets -- -D warnings
  • cargo clippy -p wit-component --all-targets -- -D warnings
  • cargo test -p wit-parser wasm_import_name_future_and_stream_intrinsics
  • cargo test -p wit-component

@peter-jerry-ye peter-jerry-ye requested a review from a team as a code owner March 3, 2026 03:54
@peter-jerry-ye peter-jerry-ye requested review from pchickey and removed request for a team March 3, 2026 03:54
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

Thanks!

@alexcrichton alexcrichton added this pull request to the merge queue Mar 3, 2026
Merged via the queue into bytecodealliance:main with commit c463da0 Mar 3, 2026
36 checks passed
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.

feature-request: extend WasmImport to include future/stream

2 participants