
24x faster Rust compilation with rust-analyzer
Edit Rust. See it change in milliseconds, in the program that is already running.
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
ra-jit
Edit Rust. See it change in milliseconds, in the program that is already running.
nix run github:indexable-inc/ra-jit
That opens a Game of Life window you can edit while it runs (live on macOS Apple silicon).
For release news: Watch → Custom → Releases on GitHub.
Live edits. Save a file and the running program has the new code about a millisecond later. Its state stays. (docs/live.md)
Fast builds. After the first build, an edit rebuilds only the functions you changed. No rustc, no waiting.
Same cargo. cargo ra-jit build|run|test|check in any project.
How fast
Live edit to running code, Game of Life demo (median of 20 edits, one 96-core Linux machine):
Edit, then build (generated 200-crate workspace, Linux x86-64, 8 CPUs, both warm and incremental, same linker, median of three):
Not measured yet: real projects, and a build from nothing against a fresh cargo build (#benchmarks).
nix run github:indexable-inc/ra-jit#ra-jit -- build
No nix? cargo +1.99.0 install --locked ra-jit, or put the binaries from a release on your PATH. Then use Rust 1.99.0 with its source: rustup toolchain install 1.99.0 -c rust-src && rustup override set 1.99.0.
nix profile install github:indexable-inc/ra-jit#ra-jit ra-jit enable
From then on plain cargo build, run, test and check in any project go through ra-jit. ra-jit disable puts your cargo config back.
ra-jit-live = "0.1"
let mut live = ra_jit_live::Live::start().ok(); loop { if let Some(outcome) = live.as_mut().and_then(|it| it.poll()) { eprintln!("ra-jit: {outcome}"); } // ...your frame }
What to know
Live edits work on macOS Apple silicon only. Elsewhere you still get fast builds.
No borrow checker: keep running cargo check.
Rust 1.99.0 only.
Changing a struct the program is using asks for a restart.
More: how it works, full results, what is supported.
ra-jit started as a fork of rustd (DioxusLabs), thanks to its authors. It has moved well past it, so use ra-jit rather than rustd. Built on rust-analyzer. Not endorsed by either project.
Made at ix for den's native app. MIT or Apache-2.0.
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。