Rewrite your app in Rust.Prove it behaves the same.
rust-anything records what your code does, then replays every recorded case against the Rust port. Your agent writes the Rust. Nothing ships until the outputs match.
export function wordCount(text: string): number { return text.split(/\s+/).filter(Boolean).length}
pub fn word_count(text: &str) -> usize { text.split_whitespace().count()}
Sponsored by
CodeRabbit
Install
Install the CLI, then register the MCP server and the workflow skill with Claude Code, Codex, Cursor and Gemini CLI.
cargo install rust-anythingrust-anything setupPrebuilt binaries for macOS, Linux and Windows are on each GitHub release.
How a port gets done
The original stays the source of truth. rust-anything does not translate code: it supplies what an agent cannot guess, and a gate that says when a port is done.
Record
recordrecordruns the original on generated edge cases, semantic traps and your own inputs, and saves what it returns or throws.Port
bridgebridgegenerates the Rust crate and a wrapper, so callers keep the original API. You or your agent write the Rust.Check
diff, gatediffreplays every recorded case against the Rust, and nothing ships until they all match andgatepasses.Lift
app liftWhen replay passes with no fallback and every unit passes gate,
app liftmakes it a pure Rust app. The original is never touched.
What the recording catches
A first port of x18n's fuzzyScore indexed by Rust char. It passed simple tests, and failed diff.
# where the time goes, and who calls it $ rust-anything profile . -- node bench.mjs $ rust-anything bridge . src/fuzzy.ts --batch fuzzyScore:text # write src/port.rs (or let your agent), then: $ rust-anything record rust/fuzzy-rs $ rust-anything build rust/fuzzy-rs $ rust-anything diff rust/fuzzy-rs $ rust-anything bench rust/fuzzy-rs $ rust-anything gate rust/fuzzy-rs
# diff, first port 198/200 cases match - fuzzyScore("b😀", "a😀b😀c"): expected {"ok":1997}, got {"ok":1998} # JS indexOf counts UTF-16 code units, # so an emoji is two positions. # with the generated utf16 helpers: # 2000/2000 cases, and the gate passes
Measured on real projects
Every number has a benchmark that first checks the results are identical. The slow cases are listed too: calling Rust once per small function is usually slower than a JIT.
HTTP cases match on a pure Rust binary (5.3 MB) after app lift, at 0% fallback. Six units pass gate.
- Memory idle, fixture database
- 74 MB → 3.5 MB
- Start to first response
- 85 / 79 ms → 9.9 / 7.9 ms
- Whole 10,000-post list, 1 connection
- 1.2x
Faster per query on 50,000 strings (91.2 ms → 2.8 ms, Apple M4). 3,414/3,414 recorded cases match; results byte-identical to Fuse on 360 searches.
- 10,000 strings
- 27 to 30x
- 1,000 strings
- 18x
- 50,000 strings, one core
- 5.3x
Cases match, 340 of them captured from its own Jest tests. A good port and a bad speed target, and bench says so.
- Per call, over the recorded cases
- 0.56x
- Batch, parse x100,000
- 18x
- Batch, format x100,000
- 0.8x
| Request (fixture database) | Node, 1 conn. | Rust, 1 conn. | Node, 50 conn. | Rust, 50 conn. |
|---|---|---|---|---|
| GET /posts | 11.1k / 10.8k | 27.3k / 23.9k | 19.7k / 20.4k | 115.0k / 110.7k |
| GET /posts/1 | 11.0k / 11.3k | 27.7k / 25.4k | 21.9k / 22.6k | 119.9k / 99.0k |
| ?_embed=comments | 8.7k / 6.6k | 22.5k / 21.8k | 13.8k / 11.0k | 98.3k / 100.6k |
| POST /comments, 10 connections | 2,973 / 2,467 | 5,821 / 5,976 |
Where the gap is small: one connection reading the whole 10,000-post list (1.2x), and writes on the big database (1.1 to 1.2x), since both rewrite the whole file on every write. Full tables
Languages
The language is detected from the repository. Every language except C also gets batches: the items cross once and stay in Rust, on all cores.

