rust-anything Release: Rewrite Apps in Rust, Piece by Piece

erkamyaman · Rust migration · ax-trend issue #4041 · Released November 16, 2026

Title card: rust-anything, rewrite in Rust piece by piece

rust-anything is a tool by erkamyaman, released on November 16, 2026, for rewriting an existing app in Rust one piece at a time without stopping the app. It first records what the running app does, then replays that recording against the Rust rewrite of each piece and flags any result that differs. Pieces that have not been ported yet fall back to the original, so the app keeps working during the migration. The project reached 2,404 GitHub stars at observation time, gaining 1,046 stars on November 17 alone, and it is MIT licensed and written in Rust.

The division of labour is the point. rust-anything does not translate code. You, or your coding agent, write the Rust. The tool supplies what an agent cannot guess reliably: where the time goes, which piece to port first, a bridge so the rest of the code calls the Rust with its API unchanged, the recorded behaviour the port must match, and a gate that says when a port is done. That turns the most expensive part of delegating a rewrite, verifying the result, into a deterministic replay check instead of a code review argument.

Record, Replay and Fallback Mechanics

The workflow starts from the original, not from the source code alone. Profiling finds the hot loop and its callers, recording captures real cases from the running app, and the port is then built against those cases. The manual sequence in the README is explicit: profile the app, generate a bridge for the chosen unit, write the Rust, record and build, run the diff so every recorded case must match, benchmark, and pass the gate. A piece ships only when the gate passes.

Diagram of the rust-anything flow: profile, record, write the Rust piece, replay and diff, gate and ship

The fallback design is what makes the approach usable on a live codebase. A strangler style migration usually needs hand written routing between old and new code. Here the bridge keeps the original API, unported units stay on the original implementation, and a failed diff blocks only that piece. In practice that means a team can port one slow path, prove it against recordings, and leave everything else untouched, which is a much smaller commitment than a flag day rewrite.

Supported Languages, Agents and Install Paths

The README lists Node.js (TypeScript and JavaScript), Python, C, Go, Ruby and Java as supported source languages, with PHP and C# in preview. Targets are CLIs, HTTP servers and libraries. Each language gets a native bridge: napi-rs or wasm-bindgen for TypeScript and JavaScript, PyO3 for Python, extern C functions for C, typed cgo calls for Go, a magnus extension for Ruby, and typed JNI for Java. PHP and C# currently record and replay whole apps, with their per unit bridges listed as coming next.

cargo install rust-anything
rust-anything setup

Installation is cargo install rust-anything from crates.io, or npm install -g rust-anything for JavaScript projects, and prebuilt binaries for macOS, Linux and Windows are attached to each GitHub release. Running rust-anything setup registers the MCP server and workflow skill with Claude Code, Codex, Cursor and Gemini CLI. Before changing an existing config file, setup saves a copy beside it, and --remove undoes the registration. In Claude Code the tool can also be installed as a plugin, although the CLI still has to be on the PATH.

Claimed Performance and the Verification Claim

The headline numbers are the author's own demo measurements on 4 cores, and the README is clear that every number has a benchmark in the demo folder that first checks the results are identical. The x18n sidebar search over 50,000 keys is reported at 10 ms per query in TypeScript and 0.5 ms after the port, a claimed 20x gain, with the same search in the browser on wasm at 11.5x. Python slugify over 20,000 strings is claimed at 17x, Ruby Shellwords.shellescape over 50,000 values at 11.8x, Go Slugify over 50,000 strings at 4x, and Java slugify over 50,000 strings at 3x.

Bar chart of claimed speedups: TypeScript 20x, Python 17x, Ruby 11.8x, Go 4x, Java 3x

The README also leads with 38,251 recorded cases replayed and 0 mismatches. Read together, the two claims describe the intended trade: speed is only reported for ports that first reproduced the original output. The author adds a useful caveat that calling Rust once per small function is usually slower than a JIT, so the tool looks for the loop worth moving rather than porting everything. That caveat is a good sign, because it narrows the claim to batch shaped hot paths instead of promising universal gains.

Limits and Unconfirmed Points

None of that cancels the idea. It defines the sensible first trial: pick one hot, well exercised path, record it heavily, port it, and let the diff and the benchmark make the call. If the gate passes and the gain is real on your own workload, the tool has done its job without asking you to bet the whole codebase on a two day old project.

FAQ

What is rust-anything?

rust-anything is a tool released by erkamyaman on November 16, 2026 that helps rewrite an existing app in Rust piece by piece. It records what the original app does, then replays those recorded cases against each Rust port before the port is accepted.

Which languages and app types does rust-anything support?

The README lists Node.js with TypeScript or JavaScript, Python, C, Go, Ruby and Java as supported, with PHP and C# in preview. The targets are CLIs, HTTP servers and libraries.

How do you install and set up rust-anything?

Install it with cargo install rust-anything or npm install -g rust-anything, then run rust-anything setup. Setup registers an MCP server and a workflow skill with Claude Code, Codex, Cursor and Gemini CLI, and Claude Code can also install it as a plugin.

How fast is a rust-anything port?

The author reports demo results measured on 4 cores, including x18n sidebar search over 50,000 keys moving from 10 ms to 0.5 ms per query, a claimed 20x gain, and Python slugify over 20,000 strings at a claimed 17x. These are author measurements with no independent verification yet.

What can rust-anything not catch?

The README states that the tool can only catch what the recording covers. Behaviour that no recorded case exercises is outside the verification scope, so recording coverage defines the checked range.

Related Reading

Sources

AI Coding Performance AX Trend