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
+7-18Lines changed: 7 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -113,8 +113,7 @@ At this stage RustPython only has preliminary support for web assembly. The inst
113
113
114
114
## Setup
115
115
116
-
To get started, install [wasm-bindgen](https://rustwasm.github.io/wasm-bindgen/whirlwind-tour/basic-usage.html)
117
-
and [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/). You will also need to have `npm` installed.
116
+
To get started, install [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/) and `npm`. ([wasm-bindgen](https://rustwasm.github.io/wasm-bindgen/whirlwind-tour/basic-usage.html) should be installed by `wasm-pack`. if not, install it yourself)
118
117
119
118
<!-- Using `rustup` add the compile target `wasm32-unknown-emscripten`. To do so you will need to have [rustup](https://rustup.rs/) installed.
120
119
@@ -132,8 +131,6 @@ cd emsdk-portable/
132
131
./emsdk activate sdk-incoming-64bit
133
132
``` -->
134
133
135
-
136
-
137
134
## Build
138
135
139
136
Move into the `wasm` directory. This contains a custom library crate optimized for wasm build of RustPython.
@@ -142,7 +139,11 @@ Move into the `wasm` directory. This contains a custom library crate optimized f
142
139
cd wasm
143
140
```
144
141
145
-
From here run the build. This can take several minutes depending on the machine.
142
+
For testing on a development server, you can run the `build.sh` script. For release build which generates files for deploying to a HTTP server, run `release.sh`.
143
+
144
+
If you don't want to use the above scripts, you can do it manually as follows:
145
+
146
+
Run the build. This can take several minutes depending on the machine.
146
147
147
148
```
148
149
wasm-pack build
@@ -169,19 +170,7 @@ and you will be able to run the files with:
169
170
node_modules/.bin/webpack-dev-server
170
171
```
171
172
172
-
Open a browser console and see the output of rustpython_wasm. To verify this, modify the line in `app/index.js`
173
-
174
-
```js
175
-
rp.run_code("print('Hello Python!')\n");
176
-
```
177
-
178
-
To the following:
179
-
180
-
```js
181
-
rp.run_code("assert(False)\n");
182
-
```
183
-
184
-
and you should observe: `Execution failed` in your console output, indicating that the execution of RustPython has failed.
173
+
Now open the webpage on https://localhost:8080, you'll be able to run Python code in the text box.
0 commit comments