Skip to content

Commit fca2327

Browse files
committed
Add documentation to README.md, and install required dependencies on ci.
1 parent c3f18a3 commit fca2327

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ jobs:
2020
- uses: actions/checkout@master
2121
- name: Set up the Windows environment
2222
run: |
23+
choco install llvm
2324
powershell.exe scripts/symlinks-to-hardlinks.ps1
2425
if: runner.os == 'Windows'
26+
- name: Set up the Mac environment
27+
run: brew install autoconf automake libtool
28+
if: runner.os == 'macOS'
2529
- name: Cache cargo dependencies
2630
uses: actions/cache@v2
2731
with:
@@ -52,8 +56,12 @@ jobs:
5256
- uses: actions/checkout@master
5357
- name: Set up the Windows environment
5458
run: |
59+
choco install llvm
5560
powershell.exe scripts/symlinks-to-hardlinks.ps1
5661
if: runner.os == 'Windows'
62+
- name: Set up the Mac environment
63+
run: brew install autoconf automake libtool
64+
if: runner.os == 'macOS'
5765
- name: Cache cargo dependencies
5866
uses: actions/cache@v2
5967
with:

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,30 @@ cargo build --release --target wasm32-wasi --features="freeze-stdlib"
7474

7575
> Note: we use the `freeze-stdlib` to include the standard library inside the binary.
7676
77+
### JIT(Just in time) compiler
78+
79+
RustPython has an **very** experimental JIT compiler that compile python functions into native code.
80+
81+
#### Building
82+
83+
By default the JIT compiler isn't enabled, it's enabled with the `jit` cargo feature.
84+
85+
$ cargo run --features jit
86+
87+
This requires autoconf, automake, libtool, and clang to be installed.
88+
89+
#### Using
90+
91+
To compile a function, call `__jit__()` on it.
92+
93+
```python
94+
def foo():
95+
a = 5
96+
return 10 + a
97+
98+
foo.__jit__() # this will compile foo to native code and subsequent calls will execute that native code
99+
assert foo() == 15
100+
```
77101

78102
## Embedding RustPython into your Rust Applications
79103

0 commit comments

Comments
 (0)