3
3
** Tier: 2**
4
4
5
5
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
7
7
[ ` wasm32-unknown-unknown ` ] ( ./wasm32-unknown-unknown.md ) target, which only has
8
8
partial support for the Rust standard library, ` wasm32-unknown-emscripten `
9
9
integrates with JavaScipt on the web to provide a more featureful standard library.
10
10
This target is often used when compiling for the web, accessing web APIs, or
11
11
interoperating with C and C++ code.
12
12
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 ) ).
17
25
18
26
## Target maintainers
19
27
@@ -28,9 +36,10 @@ said, those interested in maintaining this target are:
28
36
29
37
## Requirements
30
38
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
32
40
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.
34
43
35
44
## Building the target
36
45
0 commit comments