Skip to content

wrenlift/WrenLift

Repository files navigation

WrenLift Logo

WrenLift

A fast tiered JIT runtime for the Wren programming language.

CI Rust Rust 2021 Version 0.1.0 MIT License x86_64 | aarch64 | WASM hatch ecosystem


Wren was designed to be embedded: small, fast, and a great fit for game engines and editors. WrenLift flips that around. It runs .wren files directly as standalone scripts and apps, swapping Wren's stack interpreter for a tiered Cranelift-backed JIT. One static binary (wlift), zero runtime deps, native code on hot paths.

Pair with Hatch when you want a package manager and library ecosystem to go with it.

Install

curl -fsSL wrenlift.com/install.sh | sh

Drops wlift (the runtime) and hatch (the package + build tool) into ~/.local/bin, SHA256-verified, pulled from the latest GitHub Release.

Knobs: WLIFT_VERSION=v0.1.0 to pin a tag, INSTALL_DIR=… to retarget. macOS (arm64, x86_64) and Linux (x86_64, aarch64) are supported. Windows users grab binaries from Releases.

From source

git clone https://github.com/wrenlift/WrenLift
cd WrenLift
cargo build --release
# binaries land in target/release/{wlift, hatch}

Getting started

Try it without installing → wrenlift.com/playground.

Run a script

wlift script.wren

Start the REPL

wlift

Compile to WebAssembly

wlift --target=wasm script.wren -o output.wasm

Execution modes

wlift --mode=tiered script.wren        # default — interpret then Cranelift JIT with OSR
wlift --mode=interpreter script.wren   # MIR / bytecode / threaded interpreter only, no JIT
wlift --mode=jit script.wren           # eagerly compile everything to native

Debug dumps

wlift --dump-tokens script.wren    # lexer output
wlift --dump-ast    script.wren    # parsed AST
wlift --dump-mir    script.wren    # MIR before optimization
wlift --dump-opt    script.wren    # MIR after optimization
wlift --dump-asm    script.wren    # generated machine code
wlift --no-opt      script.wren    # run without optimization passes
wlift --gc-stats    script.wren    # print GC statistics after execution

For runtime env-var traces (tier-up tracing, OSR tracing, Cranelift IR dumps, kill switches) see the CLI reference.

Docs

  • Architecture — the compilation pipeline, optimization passes, tiered runtime, OSR.
  • CLI reference — every wlift flag, execution mode, debug dump, and runtime env var.
  • Verification & debugging — how the runtime is tested for correctness across the compiler and GC.
  • Benchmarks — head-to-head numbers, refreshed on every commit.

Acknowledgement

Wren — its syntax, semantics, and the taste behind every design choice — is the work of Robert Nystrom and the Wren contributors. The reference runtime at wren.io is the canonical implementation: small, embeddable, and a model of how much you can do with how little. WrenLift is a complementary runtime, not a replacement; it explores what the same language looks like with a JIT pipeline and a first-class WebAssembly target. Everything that makes Wren a pleasure to write — the classes, the fibers, the lean standard library — is downstream of their work, and the gratitude is sincere.

License

MIT. See LICENSE.