Skip to content

Commit 2c92474

Browse files
authored
Rollup merge of #143600 - alexcrichton:wasm32-wasip1-doc-reword, r=jieyouxu
Update intro blurb in `wasm32-wasip1` docs I was reading over this documentation in light of the effort to enlist more maintainers for Tier 2 targets and figured it was time for a refresh of this documentation now that historical renames/etc have all become a thing of the past. No new major changes to this documentation, mostly just wanted to update it and reflect the modern status quo for this target.
2 parents 19a2128 + 7ec8c89 commit 2c92474

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

src/doc/rustc/src/platform-support/wasm32-wasip1.md

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,35 @@
44

55
The `wasm32-wasip1` target is a WebAssembly compilation target which
66
assumes that the [WASIp1] (aka "WASI preview1") set of "syscalls" are available
7-
for use in the standard library. Historically this target in the Rust compiler
8-
was one of the first for WebAssembly where Rust and C code are explicitly
9-
intended to interoperate as well.
10-
11-
There's a bit of history to the target and current development which is also
12-
worth explaining before going much further. Historically this target was
13-
originally called `wasm32-wasi` in both rustc and Clang. This was first added
14-
to Rust in 2019. In the intervening years leading up to 2024 the WASI standard
15-
continued to be developed and was eventually "rebased" on top of the [Component
16-
Model]. This was a large change to the WASI specification and was released as
17-
0.2.0 ("WASIp2" colloquially) in January 2024. The previous target's name in
18-
rustc, `wasm32-wasi`, was then renamed to `wasm32-wasip1`, to avoid
19-
confusion with this new target to be added to rustc as `wasm32-wasip2`.
20-
Some more context can be found in these MCPs:
21-
22-
* [Rename wasm32-wasi target to wasm32-wasip1](https://github.com/rust-lang/compiler-team/issues/607)
23-
* [Smooth the renaming transition of wasm32-wasi](https://github.com/rust-lang/compiler-team/issues/695)
24-
25-
At this point the `wasm32-wasip1` target is intended for historical
26-
compatibility with the first version of the WASI standard. As of now (January
27-
2024) the 0.2.0 target of WASI ("WASIp2") is relatively new. The state of
28-
WASI will likely change in few years after which point this documentation will
29-
probably receive another update.
30-
31-
[WASI Preview1]: https://github.com/WebAssembly/WASI/tree/main/legacy/preview1
7+
for use in the standard library. This target explicitly supports interop with
8+
non-Rust code such as C and C++.
9+
10+
The [WASIp1] set of syscalls is standard insofar as it was written down once by
11+
a set of folks and has not changed since then. Additionally the [WASIp1]
12+
syscalls have been adapted and adopted into a number of runtimes and embeddings.
13+
It is not standard in the sense that there are no formal semantics for each
14+
syscall and APIs are no longer receiving any maintenance (e.g. no new APIs, no
15+
new documentation, etc). After [WASIp1] was originally developed in 2019 the
16+
WASI standard effort has since been "rebased" on top of the [Component Model].
17+
This was a large change to the WASI specification and was released as 0.2.0
18+
("WASIp2" colloquially) in January 2024. Current standardization efforts are
19+
focused on the Component Model-based definition of WASI. At this point the
20+
`wasm32-wasip1` Rust target is intended for historical compatibility with
21+
[WASIp1] set of syscalls.
22+
23+
[WASIp1]: https://github.com/WebAssembly/WASI/tree/main/legacy/preview1
3224
[Component Model]: https://github.com/webassembly/component-model
3325

3426
Today the `wasm32-wasip1` target will generate core WebAssembly modules
3527
which will import functions from the `wasi_snapshot_preview1` module for
3628
OS-related functionality (e.g. printing).
3729

30+
> **Note**: Prior to March 2024 this target was known as `wasm32-wasi` with some
31+
> historical context found in old MCPs:
32+
>
33+
> * [Rename wasm32-wasi target to wasm32-wasip1](https://github.com/rust-lang/compiler-team/issues/607)
34+
> * [Smooth the renaming transition of wasm32-wasi](https://github.com/rust-lang/compiler-team/issues/695)
35+
3836
## Target maintainers
3937

4038
When this target was added to the compiler platform-specific documentation here

0 commit comments

Comments
 (0)