From fca23276e0a62276883ef353d07c756ca2f102e1 Mon Sep 17 00:00:00 2001 From: Ben Lewis Date: Fri, 28 Aug 2020 06:23:09 +1200 Subject: [PATCH] Add documentation to README.md, and install required dependencies on ci. --- .github/workflows/ci.yaml | 8 ++++++++ README.md | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d2743a465..e0cb0469d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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: diff --git a/README.md b/README.md index f5a45c601..cd743819c 100644 --- a/README.md +++ b/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