hn.today

Relax: JIT compiler for Rust to reduce build times

makepad.github.io176 points102 comments
Screenshot of Relax: JIT compiler for Rust to reduce build times

Relax is a live Rust compiler and JIT runtime intended to replace the usual rustc, LLVM, linker, and parts of Cargo for development. It checks types and borrows before execution, then compiles functions when first called, starting with an interpreter and optimizing hot code in the background. Saving a file recompiles only affected functions and patches them into the running process, generally preserving its state; changes that cannot be patched trigger an in-place restart. The project says its standalone Rust implementation has 438,000 lines, no crates.io dependencies, and its own x86-64 and AArch64 code generators. On an M4 MacBook, a large game reportedly reaches its first frame in 11 seconds from a clean checkout, versus about three minutes to build with rustc; a small app takes 3.7 seconds cold and 0.41 seconds warm. After a save, 92 tests rerun in 2.2 seconds.

The central trade-off is faster development iteration for slower optimized execution. In measured workloads, Relax runs 1.14-1.26 times slower than rustc’s native-CPU release builds; a dense numeric kernel is 2.29 times slower, largely because Relax does not yet vectorize loops. The project acknowledges that a broader 18-workload test performed worse than its highlighted results and is being investigated. It also describes a development hub that keeps live sessions and warm caches for parallel AI-agent work: nine lanes reportedly handle more than 300 build and test jobs per hour. The code generation and tests currently work from fresh clones on Linux x86-64 and macOS arm64; Windows is untested.

Read on makepad.github.io102 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Ggml v1.0.0

Ggml v1.0.0

ggml 1.0.0 removes deprecated public APIs and legacy DIAG_MASK operations, while adding configurable YaRN truncation and FP8 support. It also improves backend performance with quantized matrix multiplication, fused MoE operations, and new attention and scheduling paths. (github.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.