Skip to content

Conversation

lutter
Copy link
Collaborator

@lutter lutter commented Oct 1, 2025

The fact that the runtime wasn't async was a big blocker for making other parts of the code async, especially the store. This PR switches us to using wasmtime in async mode and turns the glue functions in runtime/wasm/src/module/context.rs into async functions. Unfortunately, this change is very intrusive as it ultimately requires that asc_new becomes async.

The PR does not change the thread-per-module execution model for now, even though it would be possible to do that in tokio tasks, simply because it is safer to make that change in isolation at a later time.

The most important things to review are

  • that the many, many ToAscPtr implementations do not change the conversion and layout of data in Assemblyscript
  • that the changes to tests do not change the actual tests

@lutter lutter force-pushed the lutter/async-wasm branch from 2582eb1 to 897978d Compare October 1, 2025 21:25
@fordN fordN requested a review from isum October 2, 2025 15:35
@fordN fordN added area/runtime enhancement New feature or request labels Oct 2, 2025
lutter added 3 commits October 3, 2025 11:23
We need AscHeapCtx to be Send
In particular, that makes the host function stubs in
runtime/wasm/src/module/context.rs async which in turn will make it
possible to use async implementations in lower levels of the stack, for
example, in the store.
@lutter lutter force-pushed the lutter/async-wasm branch from 897978d to fc8865f Compare October 3, 2025 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/runtime enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants