Add documentation to README.md, and install required dependencies on ci.

This commit is contained in:
Ben Lewis
2020-08-28 06:23:09 +12:00
parent c3f18a306e
commit fca23276e0
2 changed files with 32 additions and 0 deletions

View File

@@ -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:

View File

@@ -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