Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3bc4a74

Browse files
committedNov 7, 2024
Add support for async/streams/futures
This adds support for loading, compiling, linking, and running components which use the [Async ABI](https://github.com/WebAssembly/component-model/blob/main/design/mvp/Async.md) along with the [`stream`, `future`, and `error-context`](WebAssembly/component-model#405) types. It also adds support for generating host bindings such that multiple host functions can be run concurrently with guest tasks -- without monopolizing the `Store`. See the [implementation RFC](bytecodealliance/rfcs#38) for details, as well as [this repo](https://github.com/dicej/component-async-demo) containing end-to-end smoke tests. This is very much a work-in progress, with a number of tasks remaining: - [ ] Avoid exposing global task IDs to guests and use per-instance IDs instead - [ ] Track `task.return` type during compilation and assert the actual and expected types match at runtime - [ ] Ensure all guest pointers are bounds-checked when lifting, lowering, or copying values - [ ] Reduce code duplication in `wasmtime_cranelift::compiler::component` - [ ] Reduce code duplication between `StoreContextMut::on_fiber` and `concurrent::on_fiber` - [ ] Minimize and/or document the use of unsafe code - [ ] Add support for `(Typed)Func::call_concurrent` per the RFC - [ ] Add support for multiplexing stream/future reads/writes and concurrent calls to guest exports per the RFC - [ ] Refactor, clean up, and unify handling of backpressure, yields, and even polling - [ ] Guard against reentrance where required (e.g. in certain fused adapter calls) - [ ] Add integration test cases covering new functionality to tests/all/component_model (starting by porting over the tests in https://github.com/dicej/component-async-demo) - [ ] Add binding generation test cases to crates/component-macro/tests - [ ] Add WAST tests to tests/misc_testsuite/component-model - [ ] Add support and test coverage for callback-less async functions (e.g. goroutines) - [ ] Switch to back to upstream `wasm-tools` once bytecodealliance/wasm-tools#1895 has been merged and released Signed-off-by: Joel Dice <[email protected]>
1 parent a126152 commit 3bc4a74

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+9554
-428
lines changed
 

‎Cargo.lock

+120-47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml

+9-9
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,15 @@ wit-bindgen = { version = "0.34.0", default-features = false }
274274
wit-bindgen-rust-macro = { version = "0.34.0", default-features = false }
275275

276276
# wasm-tools family:
277-
wasmparser = { version = "0.219.1", default-features = false }
278-
wat = "1.219.1"
279-
wast = "219.0.1"
280-
wasmprinter = "0.219.1"
281-
wasm-encoder = "0.219.1"
282-
wasm-smith = "0.219.1"
283-
wasm-mutate = "0.219.1"
284-
wit-parser = "0.219.1"
285-
wit-component = "0.219.1"
277+
wasmparser = { git = "https://github.com/dicej/wasm-tools", branch = "async" }
278+
wat = { git = "https://github.com/dicej/wasm-tools", branch = "async" }
279+
wast = { git = "https://github.com/dicej/wasm-tools", branch = "async" }
280+
wasmprinter = { git = "https://github.com/dicej/wasm-tools", branch = "async" }
281+
wasm-encoder = { git = "https://github.com/dicej/wasm-tools", branch = "async" }
282+
wasm-smith = { git = "https://github.com/dicej/wasm-tools", branch = "async" }
283+
wasm-mutate = { git = "https://github.com/dicej/wasm-tools", branch = "async" }
284+
wit-parser = { git = "https://github.com/dicej/wasm-tools", branch = "async" }
285+
wit-component = { git = "https://github.com/dicej/wasm-tools", branch = "async" }
286286

287287
# Non-Bytecode Alliance maintained dependencies:
288288
# --------------------------

0 commit comments

Comments
 (0)
Please sign in to comment.