Skip to content

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.

Or paste this into your coding agent

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.

Source language
Rust Anything
record3,414
diff3,414 / 3,414
gatepass
bridge
napi-rs
PyO3
cgo
JNI
JavaScript, Ruby, C, PHP, C#, Kotlin, PowerShell
TypeScriptsrc/words.tsVerified TypeScript port, Fuse.js: 3,414 / 3,414 recorded cases matchmatch
Prettier, 2,360 files 128.6 s → 6.9 s 19x faster
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.

PrettierNode 24
$ prettier <file>
3.63 s
59 / 59 files formatted
Rust portone binary
$ prettier-rs <file>
0.20 s
59 / 59 files formatted
Same output, byte for byte59 / 59match18x faster on this setHow it was measured

Install

Install the CLI, then register the MCP server and the workflow skill with Claude Code, Codex, Cursor and Gemini CLI.

  1. 01

    Install the CLI

    $cargo install rust-anything
    $rust-anything setup

    One binary from cargo or npm.

  2. 02

    Register it with your agent

    rust-anything setup adds the MCP server and the skill to Claude Code, Codex, Cursor and Gemini CLI.

  3. 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 end
rust-anything recordRecordsSaves what the original returns, throws and does
rust-anything diffChecksReplays every case against the port
rust-anything gateBlocksFails ports with copied answers, unsafe code or missing tests
rust-anything app liftShipsTurns a whole server into one Rust binary

Prebuilt 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.

Your codeNode, Python, Go, Ruby, Java, C and more
Rust Anything record
  • Runs the original on generated edge cases
  • Adds the calls your real run makes
  • Saves every return, throw and side effect
Rust Anything bridge
  • Generates the crate and a wrapper
  • Keeps the original API for callers
  • Your agent writes src/port.rs
Rust Anything diff, gate
  • Replays every recorded case
  • Names the spot where outputs differ
  • Gate blocks copied answers
Rust Anything app lift
  • Switches each port on behind the wrapper
  • One command switches it back
  • Whole apps become one Rust binary
Rust portSame API, checked case by case
{"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.

~/x18n
# 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.

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 /posts11.1k / 10.8k27.3k / 23.9k19.7k / 20.4k115.0k / 110.7k
GET /posts/111.0k / 11.3k27.7k / 25.4k21.9k / 22.6k119.9k / 99.0k
?_embed=comments8.7k / 6.6k22.5k / 21.8k13.8k / 11.0k98.3k / 100.6k
POST /comments, 10 connections2,973 / 2,4675,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

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.

Try it on your own slow code.

Free and open source. Your original stays the judge, and one command switches any port back.