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