|
4 | 4 |
|
5 | 5 | The `wasm32-wasip1` target is a WebAssembly compilation target which
|
6 | 6 | 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 |
32 | 24 | [Component Model]: https://github.com/webassembly/component-model
|
33 | 25 |
|
34 | 26 | Today the `wasm32-wasip1` target will generate core WebAssembly modules
|
35 | 27 | which will import functions from the `wasi_snapshot_preview1` module for
|
36 | 28 | OS-related functionality (e.g. printing).
|
37 | 29 |
|
| 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 | +
|
38 | 36 | ## Target maintainers
|
39 | 37 |
|
40 | 38 | When this target was added to the compiler platform-specific documentation here
|
|
0 commit comments