mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Add documentation to README.md, and install required dependencies on ci.
This commit is contained in:
8
.github/workflows/ci.yaml
vendored
8
.github/workflows/ci.yaml
vendored
@@ -20,8 +20,12 @@ jobs:
|
||||
- uses: actions/checkout@master
|
||||
- name: Set up the Windows environment
|
||||
run: |
|
||||
choco install llvm
|
||||
powershell.exe scripts/symlinks-to-hardlinks.ps1
|
||||
if: runner.os == 'Windows'
|
||||
- name: Set up the Mac environment
|
||||
run: brew install autoconf automake libtool
|
||||
if: runner.os == 'macOS'
|
||||
- name: Cache cargo dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
@@ -52,8 +56,12 @@ jobs:
|
||||
- uses: actions/checkout@master
|
||||
- name: Set up the Windows environment
|
||||
run: |
|
||||
choco install llvm
|
||||
powershell.exe scripts/symlinks-to-hardlinks.ps1
|
||||
if: runner.os == 'Windows'
|
||||
- name: Set up the Mac environment
|
||||
run: brew install autoconf automake libtool
|
||||
if: runner.os == 'macOS'
|
||||
- name: Cache cargo dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
|
||||
24
README.md
24
README.md
@@ -74,6 +74,30 @@ cargo build --release --target wasm32-wasi --features="freeze-stdlib"
|
||||
|
||||
> Note: we use the `freeze-stdlib` to include the standard library inside the binary.
|
||||
|
||||
### JIT(Just in time) compiler
|
||||
|
||||
RustPython has an **very** experimental JIT compiler that compile python functions into native code.
|
||||
|
||||
#### Building
|
||||
|
||||
By default the JIT compiler isn't enabled, it's enabled with the `jit` cargo feature.
|
||||
|
||||
$ cargo run --features jit
|
||||
|
||||
This requires autoconf, automake, libtool, and clang to be installed.
|
||||
|
||||
#### Using
|
||||
|
||||
To compile a function, call `__jit__()` on it.
|
||||
|
||||
```python
|
||||
def foo():
|
||||
a = 5
|
||||
return 10 + a
|
||||
|
||||
foo.__jit__() # this will compile foo to native code and subsequent calls will execute that native code
|
||||
assert foo() == 15
|
||||
```
|
||||
|
||||
## Embedding RustPython into your Rust Applications
|
||||
|
||||
|
||||
Reference in New Issue
Block a user