You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-14Lines changed: 36 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,9 +66,14 @@ $ cargo test --all
66
66
67
67
#Compiling to WebAssembly
68
68
69
+
At this stage RustPython only has preliminary support for web assembly. The instructions here are intended for developers or those wishing to run a toy example.
70
+
69
71
##Setup
70
72
71
-
Using`rustup` add the compile target`wasm32-unknown-emscripten`. To do so you will need to have[rustup](https://rustup.rs/) installed.
73
+
To get started, install[wasm-bingden](https://rustwasm.github.io/wasm-bindgen/whirlwind-tour/basic-usage.html)
74
+
and[wasm-webpack](https://rustwasm.github.io/wasm-pack/installer/). You will also need to have`npm` installed.
75
+
76
+
<!-- Using `rustup` add the compile target `wasm32-unknown-emscripten`. To do so you will need to have [rustup](https://rustup.rs/) installed.
72
77
73
78
```bash
74
79
rustup target add wasm32-unknown-emscripten
@@ -82,41 +87,58 @@ cd emsdk-portable/
82
87
./emsdk update
83
88
./emsdk install sdk-incoming-64bit
84
89
./emsdk activate sdk-incoming-64bit
85
-
source ./emsdk_env.sh
86
-
```
90
+
```-->
91
+
92
+
87
93
88
94
##Build
89
95
90
-
Move into the`wasm` directory. This contains a custombinary crate optimized fora web assembly build.
96
+
Move into the`wasm` directory. This contains a customlibrary crate optimized forwasm build of RustPython.
91
97
92
98
```bash
93
99
cd wasm
94
100
```
95
101
96
102
From here run the build. This can take several minutes depending on the machine.
103
+
104
+
```
105
+
wasm-pack build
106
+
```
107
+
108
+
Upon successful build, cd in the the`/pkg` directory and run: