File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 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 :
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 :
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments