Relax: experimental JIT compiler for Rust that runs code without rustc
Relax is an experimental live compiler and JIT[1] runtime for Rust, written in Rust, from the Makepad project. It runs a Cargo package straight from source, without rustc, LLVM[2] or a linker: it compiles each function on its first call, optimises hot functions while the program runs, and patches edits into the running process. It is meant for the edit-run loop, and release builds are made with cargo build --release. Code generation exists for x86-64 and AArch64, and the repository builds and passes its tests on Linux x86-64 and macOS arm64; Windows is not tested.
The project lists several limits. Overall, the code Relax runs is slower than rustc's --release build: 1.12× the time on x64 and 1.24× on arm64 (geomean[3] of 21 workloads). Relax also uses more memory, and the code cache for the hello package takes 120 to 190 MB. relax check is not yet faster than cargo check, and changes to struct layout, imports, trait or impl headers, or macros need a restart rather than patching live.
Makepad uses Relax for its agent work. Across a day of its agent lanes, an edit was patched 3.6 s (median) after it reached the machine, and 86 s at p90 on a cold JIT or cache. Nine agent lanes run side by side, and devhub handles more than 300 build and test jobs an hour.
Discussion
One Hacker News commenter notes that three AI-driven, iteration-focused Rust compilers appeared within about a month: Relax, DioxusLabs' rustd and indexable-inc's blaze. No disagreement is expressed.
Links from the post and discussion
Sources
-
github.com
GitHub - makepad/relax: Relax Rust JIT


