From 90584853b479d102211e3e738290de9926877978 Mon Sep 17 00:00:00 2001 From: Yosh Date: Wed, 17 Dec 2025 17:55:59 +0100 Subject: [PATCH 1/7] Create wasm-components.md --- src/2026/wasm-components.md | 91 +++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/2026/wasm-components.md diff --git a/src/2026/wasm-components.md b/src/2026/wasm-components.md new file mode 100644 index 00000000..d80efad4 --- /dev/null +++ b/src/2026/wasm-components.md @@ -0,0 +1,91 @@ +# Wasm Components + +| Metadata | | +| :--------------- | -------------------------------------------------------------------------------- | +| Point of contact | @yoshuawuyts | +| Status | Proposed | +| Tracking issue | *if this is a continuing goal, add the old tracking issue, else leave blank* | +| Zulip channel | N/A (an existing stream can be re-used or new streams can be created on request) | + +## Summary + +In 2026 we want to improve the state of Wasm Component support in Rust. This +means adding and stabilizing three new compiler targets. As well as begin +experimentation with Wasm-specific language features. + +## Motivation + +Rust has been at the forefront of WebAssembly support since WebAssembly was +incepted. The WASI 0.3 specification is expected be released in early 2026, +adding native support for async operations to Wasm Components. You can think of +this as morally equivalent to support for `async fn` and `async gen fn` at the +ABI level. + +Native support for async operations is not only great for networked applications +and plugins, but also specifically for targeting the web. Browser vendors have +expressed interest in natively supporting components, which opens up the +possibility for calling web APIs directly from Rust without having to roundtrip +through JavaScript. + +We want to make sure that Rust remains at the forefront of WebAssembly support, +and so during 2026 we want to do the work to make sure that stays the case. + +### The status quo + +There are a number of things with WebAssembly in Rust that are not ideal: + +- We don't have a dedicated web target in Rust, instead the ecosystem primarily + relies on the `wasm32-unknown-unknown` target which is rather brittle. +- We have a WASI 0.3 target but it is currently tier 3, which means its unavailable via `rustup` +- `std::thread` support is missing in all of the Wasm Component targets, which makes certain apps hard to port. +- Creating bare Wasm Components without WASI support uses the WASI targets, which is confusing. +- Exporting and importing WebAssembly types and functions requires third-party bindgen tooling, introducing friction. +- There is only one possible representation for an "async fn main" in WASI 0.3 and above, yet we require third-party crates to call it. + +### The next 12 months + +> *Sketch out the specific things you are trying to achieve in this goal period. This should be short and high-level -- we don't want to see the design!* + +| Task | Owner(s) | Notes | +| --------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------ | +| Bring `wasm32-wasip3` to tier 2 | @alexcrichton | | +| Introduce `wasm32-component` target as tier 3 | @alexcrichton | | +| Introduce `wasm32-web` target as tier 3 | @alexcrichton | | +| Implement `std::thread` for WASIp3 | tbd | | +| Implement `async fn main` for WASIp3 | @yoshuawuyts | | +| Experiment with `#[repr(wasm)]` and `extern "wasm"` | tbd | This item is more aspirational than the others. It would be good to do this, but we may not get to it. | + + +### The "shiny future" we are working towards + +We would like to bring Rust up to date with async support for Wasm Components. +This means adding a new WASI target (`wasm32-wasip3`) and bringing it to tier 2. +But also adding new targets for bare components with optional async support +(`wasm32-component`) and a variation of that specifically for the web +(`wasm32-component-web`). + +WebAssembly's goal is to provide a general-purpose, lightweight, and sandboxed +plugin model. Not just on the web, but also for databases, servers, embedded, +and more. We want Rust to provide a best-in-class experience for WebAssembly, +where targeting Wasm is as easy as targeting any of the native platforms. And in +some cases even exceeding what other platforms are capable of, by leaning into +WebAssembly's distinct advantages. + +This project goal brings us closer towards that shiny future, making sure we +stay up to date with the latest WebAssembly developments. While also looking to +push a little beyond that, by making WebAssembly Components easier to target +from Rust. + +## Team asks + +| Team | Support level | Notes | +| ---------- | ------------- | ---------------------------------------------------------------------------------------------------------------------- | +| [compiler] | small | New targets will need review and approval | +| [lang] | small | Experimentation with native Wasm features will need approval. May become "medium" if we are somehow really successful. | +| [libs] | small | Threading support will need review | + +## Frequently asked questions + +### What do I do with this space? + +*This is a good place to elaborate on your reasoning above -- for example, why did you put the design axioms in the order that you did? It's also a good place to put the answers to any questions that come up during discussion. The expectation is that this FAQ section will grow as the goal is discussed and eventually should contain a complete summary of the points raised along the way.* From 3e818e7fa082023d4e388cb60dcf18e46e1de503 Mon Sep 17 00:00:00 2001 From: Yosh Date: Wed, 17 Dec 2025 21:02:52 +0100 Subject: [PATCH 2/7] normalize terminology --- src/2026/wasm-components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/2026/wasm-components.md b/src/2026/wasm-components.md index d80efad4..4f3c3315 100644 --- a/src/2026/wasm-components.md +++ b/src/2026/wasm-components.md @@ -62,7 +62,7 @@ We would like to bring Rust up to date with async support for Wasm Components. This means adding a new WASI target (`wasm32-wasip3`) and bringing it to tier 2. But also adding new targets for bare components with optional async support (`wasm32-component`) and a variation of that specifically for the web -(`wasm32-component-web`). +(`wasm32-web`). WebAssembly's goal is to provide a general-purpose, lightweight, and sandboxed plugin model. Not just on the web, but also for databases, servers, embedded, From dad309579b59b0b9cdae31c0677d0259bf8df58b Mon Sep 17 00:00:00 2001 From: Yosh Date: Thu, 18 Dec 2025 18:53:50 +0100 Subject: [PATCH 3/7] Add owner for `std::thread` --- src/2026/wasm-components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/2026/wasm-components.md b/src/2026/wasm-components.md index 4f3c3315..8d627d82 100644 --- a/src/2026/wasm-components.md +++ b/src/2026/wasm-components.md @@ -51,7 +51,7 @@ There are a number of things with WebAssembly in Rust that are not ideal: | Bring `wasm32-wasip3` to tier 2 | @alexcrichton | | | Introduce `wasm32-component` target as tier 3 | @alexcrichton | | | Introduce `wasm32-web` target as tier 3 | @alexcrichton | | -| Implement `std::thread` for WASIp3 | tbd | | +| Implement `std::thread` for WASIp3 | @tartanllama | | | Implement `async fn main` for WASIp3 | @yoshuawuyts | | | Experiment with `#[repr(wasm)]` and `extern "wasm"` | tbd | This item is more aspirational than the others. It would be good to do this, but we may not get to it. | From 0528bfc3359d5a8cf8b4777b7f5856ec260d16c6 Mon Sep 17 00:00:00 2001 From: Yosh Date: Fri, 19 Dec 2025 00:25:16 +0100 Subject: [PATCH 4/7] switch web target owners --- src/2026/wasm-components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/2026/wasm-components.md b/src/2026/wasm-components.md index 8d627d82..0e7a3685 100644 --- a/src/2026/wasm-components.md +++ b/src/2026/wasm-components.md @@ -50,7 +50,7 @@ There are a number of things with WebAssembly in Rust that are not ideal: | --------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------ | | Bring `wasm32-wasip3` to tier 2 | @alexcrichton | | | Introduce `wasm32-component` target as tier 3 | @alexcrichton | | -| Introduce `wasm32-web` target as tier 3 | @alexcrichton | | +| Introduce `wasm32-web` target as tier 3 | @yoshuawuyts | | | Implement `std::thread` for WASIp3 | @tartanllama | | | Implement `async fn main` for WASIp3 | @yoshuawuyts | | | Experiment with `#[repr(wasm)]` and `extern "wasm"` | tbd | This item is more aspirational than the others. It would be good to do this, but we may not get to it. | From eacf46589e1854ce538f40719d16ff6b4da5276c Mon Sep 17 00:00:00 2001 From: Yosh Date: Fri, 19 Dec 2025 17:27:12 +0100 Subject: [PATCH 5/7] Add work explainers --- src/2026/wasm-components.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/2026/wasm-components.md b/src/2026/wasm-components.md index 0e7a3685..4f761a53 100644 --- a/src/2026/wasm-components.md +++ b/src/2026/wasm-components.md @@ -46,14 +46,14 @@ There are a number of things with WebAssembly in Rust that are not ideal: > *Sketch out the specific things you are trying to achieve in this goal period. This should be short and high-level -- we don't want to see the design!* -| Task | Owner(s) | Notes | -| --------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------ | -| Bring `wasm32-wasip3` to tier 2 | @alexcrichton | | -| Introduce `wasm32-component` target as tier 3 | @alexcrichton | | -| Introduce `wasm32-web` target as tier 3 | @yoshuawuyts | | -| Implement `std::thread` for WASIp3 | @tartanllama | | -| Implement `async fn main` for WASIp3 | @yoshuawuyts | | -| Experiment with `#[repr(wasm)]` and `extern "wasm"` | tbd | This item is more aspirational than the others. It would be good to do this, but we may not get to it. | +| Task | Owner(s) | Notes | +| --------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Bring `wasm32-wasip3` to tier 2 | @alexcrichton | This is the WASI 0.3 target, with support for component model async features. It unlocks async-async component composition, as well as cooperative threading. | +| Introduce `wasm32-component` target as tier 3 | @alexcrichton | This target is very similar to `wasm32-wasip3`, but does not include the WASI APIs, making it `#[no_std]` + `alloc`. | +| Introduce `wasm32-component-web` target as tier 3 | @yoshuawuyts | This target is very similar to `wasm32-component`, but with a different `cfg` that enables an ecosystem to be built specifically targeting the web. | +| Implement `std::thread` for WASIp3 | @tartanllama | This is a future extension to the component model, which will be part of a WASI 0.3.x release. Enables Wasm Components' "cooperative multi-threading" feature. | +| Implement `async fn main` for WASIp3 | @yoshuawuyts | | +| Experiment with `#[repr(wasm)]` and `extern "wasm"` | tbd | This item is more aspirational than the others. It would be good to do this, but we may not get to it. | ### The "shiny future" we are working towards @@ -62,7 +62,7 @@ We would like to bring Rust up to date with async support for Wasm Components. This means adding a new WASI target (`wasm32-wasip3`) and bringing it to tier 2. But also adding new targets for bare components with optional async support (`wasm32-component`) and a variation of that specifically for the web -(`wasm32-web`). +(`wasm32-component-web`). WebAssembly's goal is to provide a general-purpose, lightweight, and sandboxed plugin model. Not just on the web, but also for databases, servers, embedded, From 3d9165ec14de51b8b39a0532270cee7b8222a185 Mon Sep 17 00:00:00 2001 From: Yosh <2467194+yoshuawuyts@users.noreply.github.com> Date: Fri, 19 Dec 2025 17:38:38 +0100 Subject: [PATCH 6/7] Update src/2026/wasm-components.md Co-authored-by: Tshepang Mbambo --- src/2026/wasm-components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/2026/wasm-components.md b/src/2026/wasm-components.md index 4f761a53..65059f30 100644 --- a/src/2026/wasm-components.md +++ b/src/2026/wasm-components.md @@ -16,7 +16,7 @@ experimentation with Wasm-specific language features. ## Motivation Rust has been at the forefront of WebAssembly support since WebAssembly was -incepted. The WASI 0.3 specification is expected be released in early 2026, +incepted. The WASI 0.3 specification is expected to be released in early 2026, adding native support for async operations to Wasm Components. You can think of this as morally equivalent to support for `async fn` and `async gen fn` at the ABI level. From 99db7367aa342bc0e5f2375dd8457e41c46f5b06 Mon Sep 17 00:00:00 2001 From: Yosh <2467194+yoshuawuyts@users.noreply.github.com> Date: Fri, 19 Dec 2025 17:39:23 +0100 Subject: [PATCH 7/7] Apply suggestions from code review Co-authored-by: Tshepang Mbambo --- src/2026/wasm-components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/2026/wasm-components.md b/src/2026/wasm-components.md index 65059f30..c2e3d5cc 100644 --- a/src/2026/wasm-components.md +++ b/src/2026/wasm-components.md @@ -10,7 +10,7 @@ ## Summary In 2026 we want to improve the state of Wasm Component support in Rust. This -means adding and stabilizing three new compiler targets. As well as begin +means adding and stabilizing three new compiler targets, as well as begin experimentation with Wasm-specific language features. ## Motivation