Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit93f70ab

Browse files
Merge pull requestRustPython#1108 from RustPython/update-docs
Update documentation folder and readme.
2 parentsbcf470e +5c39350 commit93f70ab

20 files changed

+84
-1202
lines changed

‎README.md‎

Lines changed: 12 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -105,99 +105,31 @@ There also are some unit tests, you can run those with cargo:
105105
$ cargotest --all
106106
```
107107

108-
#Usinganother standard library
108+
#Usinga standard library
109109

110-
As of now the standard library is under construction.
111-
112-
You can play around
113-
with other standard libraries for python. For example,
114-
the[ouroboros library](https://github.com/pybee/ouroboros).
110+
As of now the standard library is under construction. You can
111+
use a standard library by setting the RUSTPYTHONPATH environment
112+
variable.
115113

116114
To do this, follow this method:
117115

118116
```shell
119-
$cd~/GIT
120-
$ git clone git@github.com:pybee/ouroboros.git
121-
$export RUSTPYTHONPATH=~/GIT/ouroboros/ouroboros
122-
$cd RustPython
123-
$ cargo run -- -c'import statistics'
124-
```
125-
126-
#Compiling to WebAssembly
127-
128-
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.
129-
130-
##Setup
131-
132-
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)
133-
134-
<!-- Using `rustup` add the compile target `wasm32-unknown-emscripten`. To do so you will need to have [rustup](https://rustup.rs/) installed.
135-
136-
```bash
137-
rustup target add wasm32-unknown-emscripten
138-
```
139-
140-
Next, install `emsdk`:
141-
142-
```bash
143-
curl https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | tar -zxv
144-
cd emsdk-portable/
145-
./emsdk update
146-
./emsdk install sdk-incoming-64bit
147-
./emsdk activate sdk-incoming-64bit
148-
```-->
149-
150-
##Build
151-
152-
Move into the`wasm` directory. This directory contains a library crate for interop
153-
with python to rust to js and back in`wasm/lib`, the demo website found at
154-
https://rustpython.github.io/demo in`wasm/demo`, and an example of how to use
155-
the crate as a library in one's own JS app in`wasm/example`.
156-
157-
```sh
158-
cd wasm
159-
```
160-
161-
Go to the demo directory. This is the best way of seeing the changes made to either
162-
the library or the JS demo, as the`rustpython_wasm` module is set to the global
163-
JS variable`rp` on the website.
164-
165-
```sh
166-
cd demo
117+
$export RUSTPYTHONPATH=~/GIT/RustPython/Lib
118+
$ cargo run -- -c'import xdrlib'
167119
```
168120

169-
Now, start the webpack development server. It'll compile the crate and then
170-
the demo app. This will likely take a long time, both the wasm-pack portion and
171-
the webpack portion (from after it says "Your crate has been correctly compiled"),
172-
so be patient.
173-
174-
```sh
175-
npm run dev
176-
```
121+
You can play around
122+
with other standard libraries for python. For example,
123+
the[ouroboros library](https://github.com/pybee/ouroboros).
177124

178-
You can now open the webpage onhttps://localhost:8080 and Python code in either
179-
the text box or browser devtools with:
180-
181-
```js
182-
rp.pyEval(
183-
`
184-
print(js_vars['a'] * 9)
185-
`,
186-
{
187-
vars: {
188-
a:9
189-
}
190-
}
191-
);
192-
```
125+
#Compiling to WebAssembly
193126

194-
Alternatively, you can run`npm run build` to build the app once, without watching
195-
for changes, or`npm run dist` to build the app in release mode, both for the
196-
crate and webpack.
127+
[See this doc](wasm/README.md)
197128

198129
#Code style
199130

200131
The code style used is the default[rustfmt](https://github.com/rust-lang/rustfmt) codestyle. Please format your code accordingly.
132+
We also use[clippy](https://github.com/rust-lang/rust-clippy) to detect rust code issues.
201133

202134
#Community
203135

‎docs/builtins.md‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎docs/compat-test.md‎

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎docs/frameTODO.txt‎

Lines changed: 0 additions & 13 deletions
This file was deleted.
-17.9 MB
Binary file not shown.

‎docs/notes.md‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎docs/reference.md‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎docs/sharing.md‎

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp