← Back to archive

Repo of the Day

erkamyaman/rust-anything: Rewrite your whole app in Rust, one piece at a time, checked against the original's recorded behavior at every step. CLIs, HTTP servers and libraries in TypeScript, Python, C, Go, Ruby and Java.

Published: Nov 18, 2026

Open repository ↗

Rewrite your whole app in Rust, one piece at a time, checked against the original's recorded behavior at every step. CLIs, HTTP servers and libraries in TypeScript, Python, C, Go, Ruby and Java...

Summary

rust-anything is a Rust CLI and MCP server for rewriting an existing application in Rust one piece at a time, checking every Rust port against a recording of what the original code actually did. It handles Node.js/TypeScript, Python, C, Go, Ruby and Java sources (PHP and C# in preview) and deliberately does not translate code — you or your coding agent write the Rust, while the tool supplies profiling, scaffolding, and evidence of equivalence.

What it is useful for

  • Porting a hot path without rewriting the app. rust-anything profile runs a real workload under the language's profiler (node, cProfile, go test pprof, JFR, a Ruby tracer) and lists hot functions by inclusive time and their callers, so you know what to move first.
  • Proving behavior before cutover. record runs the original on generated edge cases (non-ASCII, emoji, -0, NaN, signed division, overflow edges, float printing, map and sort order) and saves what it returns or throws; diff replays every case against the Rust and lists mismatches.
  • Whole-app migrations. app record/app replay treat a CLI or server as a black box, with cases stored as trycmd files under rust/app-cases/, a replay-report.md you can diff in CI, and app lift that refuses to remove the fallback path until every unit passes gate.
  • Agent-driven workflows. rust-anything setup registers the MCP server and workflow skill with Claude Code, Codex, Cursor and Gemini CLI.

Documented limitations are worth reading before you start: it can only catch what the recording covers; PHP and C# are preview (their FFI/P-Invoke steps are "coming next"); and the README's own case study reports x18n's core ports were slower than the TypeScript as called from JS, because the bridge cost more than the work. The tool also flags code already compiled (numba, Cython, JAX), where Rust gains little.

How engineers can use it

Install and register with your agent:

cargo install rust-anything
rust-anything setup        # --remove undoes it

Prebuilt binaries for macOS, Linux and Windows are attached to each GitHub release, and npm install -g rust-anything installs the same binary for JavaScript projects. Claude Code users can also run /plugin install rust-anything --marketplace erkamyaman/rust-anything.

The per-unit loop:

rust-anything profile . -- node bench.mjs
rust-anything bridge . src/fuzzy.ts --batch fuzzyScore:text
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

gate runs fmt, clippy -D warnings, tests, an unsafe audit, and requires a recorded failing case for every error path of the original.

Repo: https://github.com/erkamyaman/rust-anything (MIT). Benchmarks referenced by the README live in demo/.