Skip to content

Commit cfb6ccc

Browse files
authored
Add more references to Emscripten and WASI
1 parent eb91c7c commit cfb6ccc

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

src/doc/rustc/src/platform-support/wasm32-unknown-emscripten.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,25 @@
33
**Tier: 2**
44

55
The `wasm32-unknown-emscripten` target is a WebAssembly compilation target which
6-
uses the Emscripten compiler toolchain. Unlike the
6+
uses the [Emscripten](https://emscripten.org/) compiler toolchain. Unlike the
77
[`wasm32-unknown-unknown`](./wasm32-unknown-unknown.md) target, which only has
88
partial support for the Rust standard library, `wasm32-unknown-emscripten`
99
integrates with JavaScipt on the web to provide a more featureful standard library.
1010
This target is often used when compiling for the web, accessing web APIs, or
1111
interoperating with C and C++ code.
1212

13-
One existing user of this target (please feel free to edit and expand this list
14-
too) is the [`pyodide` project](https://github.com/pyodide/pyodide) which provides
15-
a Python runtime in WebAssembly using Emscripten and compiles Python extension
16-
modules written in Rust to the `wasm32-unknown-emscripten` target.
13+
One existing user of this target is the
14+
[`pyodide` project](https://github.com/pyodide/pyodide) which provides a Python
15+
runtime in WebAssembly using Emscripten and compiles Python extension modules
16+
written in Rust to the `wasm32-unknown-emscripten` target.
17+
18+
If you want to target the web but no not need interop with C/C++ or you want to
19+
produce a bare-bones WebAssembly binary and you do not require access to the host
20+
environment (e.g. stdio, file access, networking, etc.), consider using the
21+
[`wasm32-unknown-unknown`](./wasm32-unknown-unknown) target instead.
22+
23+
If you need access to the host environment, consider using one of the WASI targets
24+
([`wasm32-wasip1`](./wasm32-wasip1) or [`wasm32-wasip2`](./wasm32-wasip2)).
1725

1826
## Target maintainers
1927

@@ -28,9 +36,10 @@ said, those interested in maintaining this target are:
2836

2937
## Requirements
3038

31-
This target is cross-compiled. The Emscripten compiler toolchain must be
39+
This target is cross-compiled. The Emscripten compiler toolchain (emsdk) must be
3240
installed to link Rust-compiled code with Emscripten's libc and other C/C++
33-
code.
41+
code. Please refer to https://emscripten.org/docs/getting_started/downloads.html
42+
on how to get started with the emsdk.
3443

3544
## Building the target
3645

0 commit comments

Comments
 (0)