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.
Install Rust Anything with npm i -g rust-anything, then run rust-anything setup. Run rust-anything go -- <slow command of this app> and finish the port until rust-anything gate passes.
src/words.tsVerified TypeScript port, Fuse.js: 3,414 / 3,414 recorded cases matchmatch- 32x
- Fuse.js search per query on 50,000 strings, Apple M4
- 3.5MB
- json-server idle memory after the lift, from 74 MB in Node
- 514/514
- json-server HTTP cases matching on a pure Rust binary
- 10
- languages: eight with verified ports, Kotlin and PowerShell tested end to end
Sponsored by CodeRabbit and Atak Domain.
Free and open source, MIT or Apache-2.0. Using it at work? Sponsor the project
Prettier, ported to Rust
Prettier and its Rust port format the same 59 real files, one process per file: Prettier takes 3.63 s, the Rust port 0.20 s, with the same output byte for byte.
$ prettier <file>$ prettier-rs <file>Install
Install the CLI, then register the MCP server and the workflow skill with Claude Code, Codex, Cursor and Gemini CLI.
- 01
Install the CLI
$cargo install rust-anything$rust-anything setupOne binary from cargo or npm.
- 02
Register it with your agent
rust-anything setupadds the MCP server and the skill to Claude Code, Codex, Cursor and Gemini CLI. - 03
Ask for the slow part
Say "move the hot loop to Rust". The agent profiles, records, ports and stops when every case matches.
rust-anything goPortsProfiles a real run and ports the slow part end to endrust-anything recordRecordsSaves what the original returns, throws and doesrust-anything diffChecksReplays every case against the portrust-anything gateBlocksFails ports with copied answers, unsafe code or missing testsrust-anything app liftShipsTurns a whole server into one Rust binaryPrebuilt 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- Runs the original on generated edge cases
- Adds the calls your real run makes
- Saves every return, throw and side effect
bridge- Generates the crate and a wrapper
- Keeps the original API for callers
- Your agent writes src/port.rs
diff, gate- Replays every recorded case
- Names the spot where outputs differ
- Gate blocks copied answers
app lift- Switches each port on behind the wrapper
- One command switches it back
- Whole apps become one Rust binary
{"fn":"wordCount","args":["a\u00a0b"],"ok":1}rust-anything bridge . src/words.ts3,414 / 3,414 cases identical, gate passesJavaScript left in json-server: 99.8% to 22.6% to 0%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
Orange rows are where Rust gains little or loses: the honest cases, shown on purpose.
json-server benchmark · requests per second, run 1 / run 2 · Apple M4, Node 24.15.0
| 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, PHP, C# and PowerShell also gets batches: the items cross once and stay in Rust, on all cores.
- VerifiedTypeScript/JavaScriptjson-server, Fuse.js, vercel/ms, x18nnapi-rs or wasm-bindgen
- VerifiedPython2,400/2,400CPython colorsysPyO3
- VerifiedC1,859/1,859glibc facadeextern "C"
- VerifiedGo2,642/2,642Go pathcgo and a binary wire
- VerifiedRuby1,617/1,617shellwordsmagnus
- VerifiedJava4,492/4,492JDK facadeJNI and a binary wire
- VerifiedPHP1,838/1,838PEAR XML_Utilext-ffi
- VerifiedC#2,941/2,941Google.ProtobufP/Invoke
- TestedKotlinTested on a Gradle fixtureJNI through the Java bridge
- TestedPowerShellTested on a .psm1 fixtureP/Invoke, pwsh 7.4+
Built by 42 contributors
Ports, parser fixes, translations and bug reports from people who use it. A good first issue is the easiest way in.
Sponsors
Rust Anything is free and open source. If it helps your work, please consider sponsoring it. Your support keeps development going.
Sponsoring as a company? Write to hello@rustanything.ai
Try it on your own slow code.
Free and open source. Your original stays the judge, and one command switches any port back.