{"slug": "rust-anything-port-apps-to-rust-and-check-them-against-the-original", "title": "Rust Anything – Port apps to Rust and check them against the original", "summary": "Erkam Yaman released rust-anything 2.0, an MIT-licensed tool that records the behavior of Node.js, Python, C, Go, Ruby or Java apps and checks a Rust rewrite against that recording before each piece is lifted. The project reports a Prettier 3.6.2 port running 19x faster (6.9 s versus 128.6 s on 2,360 JS/TS files) with 17,224 recorded runs and 0 mismatches, and a json-server port using 3.5 MB at idle versus 74 MB, with 15,837 of 17,224 recorded runs formatting fully in Rust.", "body_md": "**Rewrite your app in Rust, and prove it still behaves the same.**\n\nNew in 2.0: [Prettier, ported to Rust](https://github.com/erkamyaman/rust-anything/blob/main/docs/real-world.md#prettier). 19x faster · 17,224 recorded runs · 0 mismatches\n\n[Quick start](#quick-start) ·\n  [Languages](#languages) ·\n  [Real-world ports](https://github.com/erkamyaman/rust-anything/blob/main/docs/real-world.md) ·\n  [How it works](https://github.com/erkamyaman/rust-anything/blob/main/docs/how-it-works.md#how-it-works) ·\n  [Whole apps](https://github.com/erkamyaman/rust-anything/blob/main/docs/whole-apps.md#port-a-whole-app) ·\n  [FAQ](https://github.com/erkamyaman/rust-anything/blob/main/docs/faq.md#faq)\n\nMade in Türkiye 🇹🇷 by [erKam Yaman](https://github.com/erkamyaman) · [MIT](https://github.com/erkamyaman/rust-anything/blob/main/LICENSE) · [❤️ Sponsor me](https://github.com/sponsors/erkamyaman)\n\nSponsored by  [**CodeRabbit**](https://coderabbit.ai)\n\n<sub>English · [Türkçe](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_TR.md) · [Українська](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_UK.md) · [简体中文](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_ZH.md) · [繁體中文](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_ZH-TW.md) · [Deutsch](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_DE.md) · [Français](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_FR.md) · [Русский](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_RU.md) · [日本語](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_JA.md) · [한국어](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_KO.md) · [Azərbaycanca](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_AZ.md) · [Oʻzbekcha](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_UZ.md) · [Қазақша](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_KK.md) · [Кыргызча](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_KY.md) · [Türkmençe](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_TK.md) · [Татарча](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_TT.md) · [ئۇيغۇرچە](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_UG.md) · [Português](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_PT.md) · [Tiếng Việt](https://github.com/erkamyaman/rust-anything/blob/main/docs/README_VI.md)</sub>\n\n| **Record**`record` runs the original on generated edge cases, semantic traps and your own inputs, and saves what it returns or throws. | **Port**`bridge` generates the Rust crate and a wrapper, so callers keep the original API. You or your agent write the Rust. | **Check**`diff` replays every recorded case against the Rust, and nothing ships until they all match and`gate` passes. | **Lift** When replay passes with no fallback and every unit passes gate, `app lift` makes it a pure Rust app. The original is never touched. | \n\n**Rewrite your whole app in Rust, one piece at a time.** rust-anything records what your\nNode.js (TypeScript/JavaScript), Python, C, Go, Ruby or Java app does today, then checks every piece of the\nRust rewrite against that recording before it moves on, until the app is pure Rust. CLIs, HTTP\nservers and libraries; your coding agent (or you) writes the Rust. It can only catch what the\nrecording covers: see [What it can't catch](https://github.com/erkamyaman/rust-anything/blob/main/docs/how-it-works.md#what-it-cant-catch). Whole tools\nand servers, or only the slow part, one hot path at a time:\n\n| Real project, same output as the original | Original | With rust-anything | \n|---|---|---|\n| [Prettier](https://github.com/erkamyaman/rust-anything/blob/main/docs/real-world.md#prettier) 3.6.2, 2,360 JS/TS files from the command line | 128.6 s | **6.9 s: 19x faster** | \n| Prettier, 6,305 Markdown files from the command line | 352 s | **22.5 s: 15.6x faster** | \n| [json-server](https://github.com/erkamyaman/rust-anything/blob/main/docs/real-world.md#json-server) , a whole Node server: memory at idle | 74 MB | **3.5 MB** , one 5.3 MB binary | \n| json-server, from start to first response | 79 to 85 ms | **8 to 10 ms** | \n| [Fuse.js](https://github.com/erkamyaman/rust-anything/blob/main/docs/real-world.md#fusejs) search over 50,000 strings, per query | 91.2 ms | **2.8 ms: 32x faster** | \n\nPrettier: 15,837 of 17,224 recorded runs format fully in Rust across 10 languages (JavaScript,\nTypeScript, JSX, JSON, GraphQL, YAML, Markdown, CSS, SCSS, Less), and all 17,224 match Prettier\nbyte for byte, since anything not ported yet falls back to Prettier. json-server: 514/514\nrecorded HTTP cases match on a pure Rust binary. Measured on an Apple M4, two runs each, every\noutput compared before timing ([details](https://github.com/erkamyaman/rust-anything/blob/main/docs/real-world.md)). Calling Rust once per small\nfunction is usually *slower* than a JIT; rust-anything finds the loop worth moving, and moves it.\n\n<sub>Prettier against its Rust port on 59 real files from ms, Fuse.js and json-server (Apple M4). Same output, byte for byte. [How it was measured](https://github.com/erkamyaman/rust-anything/blob/main/docs/real-world.md#prettier).</sub>\n\n<sub>json-server, a whole Node server, lifted to a pure Rust binary (Apple M4). [How it was measured](https://github.com/erkamyaman/rust-anything/blob/main/docs/real-world.md#json-server).</sub>\n\nrust-anything is an independent project, not affiliated with or endorsed by the Rust Project or the Rust Foundation. \"Rust\" is a trademark of the Rust Foundation.\n\nWarning\n\n`record` and `app record` run your original code, calling each function (or the whole app) on\nmany generated inputs, and `app record` runs every case twice. `diff`, `gate` and `app replay`\nrun the same cases again, on the port or the original. Code that writes files, talks to a\ndatabase or calls the network does that once per case. Run them on a copy of the project, with a\ntest database and no production credentials in the environment.\n\nPaste this into Claude Code, Codex, Cursor, Gemini CLI or OpenCode and let your agent install it:\n\n```\nInstall rust-anything: run `cargo install rust-anything`, then `rust-anything setup`.\nTell me when to restart you.\n```\n\nOr yourself:\n\n```\ncargo install rust-anything   # from crates.io\nrust-anything setup           # registers it with Claude Code, Codex, Cursor, Gemini CLI and OpenCode\n```\n\nNo Rust toolchain yet? Prebuilt binaries for macOS, Linux and Windows are attached to each\n[GitHub release](https://github.com/erkamyaman/rust-anything/releases), and for JavaScript\nprojects `npm install -g rust-anything` installs the same binary.\n\nIn Claude Code you can also install it as a plugin (the MCP server and the skill; the CLI above\nmust be on your `PATH`):\n\n```\n/plugin install rust-anything --marketplace erkamyaman/rust-anything\n```\n\n`setup` adds the MCP server to each agent it finds and installs the workflow skill where the agent\nreads skills. It keeps your other settings, is safe to run again, and `--remove` undoes it.\nThen ask your agent, for example:\n\n- *\"Rewrite this CLI in Rust with rust-anything, end to end, and prove it behaves the same.\"*\n- *\"This search feels slow. Profile it with rust-anything and move the hot loop to Rust.\"*\n- *\"Plan a migration of `src/parser/` to Rust with rust-anything; port the first unit and prove it.\"*\n- *\"Bench the Rust port in `rust/text-rs` against the original and tell me whether to ship it.\"*\n\n| Agent | `rust-anything setup` adds | \n|---|---|\n| Claude Code | MCP server in `~/.claude.json` , skill in`~/.claude/skills/` | \n| Codex | MCP server in `~/.codex/config.toml` , skill in`~/.codex/skills/` | \n| Cursor | MCP server in `~/.cursor/mcp.json` | \n| Gemini CLI | MCP server in `~/.gemini/settings.json` | \n| OpenCode | MCP server in `~/.config/opencode/opencode.json` (`mcp.servers` ), skill in`~/.config/opencode/skills/` | \n| Any other MCP client | add `rust-anything mcp` as a stdio server by hand (see[Install](https://github.com/erkamyaman/rust-anything/blob/main/docs/install.md#install) ) | \n\nBefore changing a file that exists, `setup` saves a copy beside it (`<file>.rust-anything.bak`).\n\nTo wire OpenCode up by hand, put the server in `~/.config/opencode/opencode.json` (`command` is\nthe whole argv) and copy [`skills/rust-anything/`](https://github.com/erkamyaman/rust-anything/blob/main/skills/rust-anything) to\n`~/.config/opencode/skills/rust-anything/`:\n\n```\n{\n  \"mcp\": {\n    \"servers\": {\n      \"rust-anything\": { \"type\": \"local\", \"command\": [\"rust-anything\", \"mcp\"] }\n    }\n  }\n}\n```\n\nOr run the steps yourself:\n\n```\nrust-anything profile . -- node bench.mjs              # what is hot, and who calls it\nrust-anything bridge . src/fuzzy.ts --batch fuzzyScore:text\n# write src/port.rs (or let your agent), then:\nrust-anything record rust/fuzzy-rs && rust-anything build rust/fuzzy-rs\nrust-anything diff rust/fuzzy-rs                       # every recorded case must match\nrust-anything bench rust/fuzzy-rs                      # faster? the verdict says\nrust-anything gate rust/fuzzy-rs                       # done means this passes\n```\n\nrust-anything does not translate code: your coding agent (Claude Code, Codex, Cursor, OpenCode, ...) or you write the Rust. rust-anything supplies what an agent cannot guess reliably: where the time goes, what to port first and in which order, a bridge so the rest of the code calls the Rust with its API unchanged, the exact behavior the port must match, a safe way to ship it, and a gate that says when a port is done.\n\nSame output is not enough. Record what the app sends too, and a rewrite that mails twice fails:\n\n<sub>A real run of `app record --effects` and `app replay`. See [Side effects](https://github.com/erkamyaman/rust-anything/blob/main/docs/whole-apps.md#side-effects-email-webhooks-and-databases).</sub>\n\n| Language | Unit | Bridge | Recorded and replayed by | \n|---|---|---|---|\n| TypeScript/JavaScript | folder or file | napi-rs or wasm-bindgen with a generated binary wire; classes and async included | Node, running the `.ts` sources | \n| Python | package or module | PyO3 (abi3), direct conversion, typed exceptions | Python, importing the original | \n| C | `.c` file | `extern \"C\"` functions with the original names and a header | the original compiled to a shared library, called through ctypes, one fork per case | \n| Go | package | typed cgo calls and a generated binary wire, in a package with the original API | a generated Go driver, built as its own module | \n| Ruby | file or folder of module functions | a magnus extension under the original modules | a generated Ruby driver | \n| Java | package of `public static` methods | typed JNI and a generated binary wire, in wrapper classes with the original methods | a generated reflection driver | \n| PHP | folder of functions and `public static` methods | coming next: PHP FFI over a C ABI | whole apps today: `app record` ,`app replay` and the front door, for CLIs and servers (`php -S` ) | \n| C# | folder of `public static` methods | coming next: P/Invoke over a C ABI | whole apps today: `app record` ,`app replay` and the front door, for CLIs and ASP.NET servers (`dotnet <app>.dll` ) | \n\nEvery language except C also gets batch classes (`--batch`): the items cross once and stay in\nRust, and each call runs over all of them on all cores.\n\nThe language is detected from the repository (`go.mod`, `pom.xml`, a `.csproj` or `.sln`,\n`pyproject.toml`, `Gemfile`, `composer.json`, `package.json`, else the most common source files);\n`--lang` overrides it. Types come from the source: TS types, Python hints, C, Go, Java and C#\nsignatures, Ruby YARD tags, PHP types and phpdoc; untyped parameters used as numbers are inferred\nas numbers.\n\nFor PHP, `analyze` plans a PHP app (Composer packages and PSR-4 autoloading, risks\nsuch as loose comparison and integer overflow into floats, Composer packages mapped to crates),\nand a PHP CLI or server can be recorded, replayed and put behind a Rust front door. Porting its\nunits into Rust through PHP's FFI is the next step ([issue #2](https://github.com/erkamyaman/rust-anything/issues/2)).\n\nC# works the same way: `analyze` reads `.csproj` projects and their NuGet packages\n(mapped to crates), resolves `using` directives to folders, and flags what C# does differently\n(`decimal`, `dynamic`, LINQ's deferred queries, `Task`, `lock`, reflection). A C# CLI or ASP.NET\nserver can be recorded, replayed and put behind a Rust front door; porting units through P/Invoke\ncomes next.\n\n- [How it works](https://github.com/erkamyaman/rust-anything/blob/main/docs/how-it-works.md) : the loop, what`bridge` and`analyze` decide, hot paths, what it can't catch, what a real port takes, and keeping up with the original (`map` )\n- [Port a whole app](https://github.com/erkamyaman/rust-anything/blob/main/docs/whole-apps.md) : servers, CLIs and libraries, from the front door to`app lift`\n- [Examples and case studies](https://github.com/erkamyaman/rust-anything/blob/main/docs/examples.md) : x18n, and real code in six languages\n- [Real-world ports](https://github.com/erkamyaman/rust-anything/blob/main/docs/real-world.md) : json-server, Fuse.js, vercel/ms, with benchmarks\n- [Install, update and develop](https://github.com/erkamyaman/rust-anything/blob/main/docs/install.md) : every install method, Windows, and building from source\n- [FAQ](https://github.com/erkamyaman/rust-anything/blob/main/docs/faq.md) ·[Status](https://github.com/erkamyaman/rust-anything/blob/main/docs/STATUS.md) ·[MCP tools](https://github.com/erkamyaman/rust-anything/blob/main/docs/tools.md)\n\n[rust-anything](https://github.com/erkamyaman/rust-anything) is free and open source. If it helps your work, please consider sponsoring it.\n\n  Your support keeps development going.\n\nIssues and pull requests are welcome; [CONTRIBUTING.md](https://github.com/erkamyaman/rust-anything/blob/main/CONTRIBUTING.md) covers the setup, where\ntests go, and how to add a language. Design choices and their reasons are in\n[DECISIONS.md](https://github.com/erkamyaman/rust-anything/blob/main/DECISIONS.md). Case studies of real ports are especially welcome. Please report\nsecurity problems privately ([SECURITY.md](https://github.com/erkamyaman/rust-anything/blob/main/SECURITY.md)), and see the\n[code of conduct](https://github.com/erkamyaman/rust-anything/blob/main/CODE_OF_CONDUCT.md).\n\n[MIT](https://github.com/erkamyaman/rust-anything/blob/main/LICENSE) © [Erkam Yaman](https://github.com/erkamyaman). Ports and generated code in your repository are yours.", "url": "https://wpnews.pro/news/rust-anything-port-apps-to-rust-and-check-them-against-the-original", "canonical_source": "https://github.com/erkamyaman/rust-anything", "published_at": "2026-11-19 11:01:23+00:00", "updated_at": "2026-11-19 11:15:16.386450+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents"], "entities": ["rust-anything", "Erkam Yaman", "Prettier", "json-server", "Fuse.js", "CodeRabbit", "Rust"], "also_reported_by": [], "takeaway": "rust-anything 2.0 records the original app's outputs on edge cases and replays them against the Rust port, and its Prettier port matched all 17,224 recorded runs while running 19x faster (6.9 s vs 128.6 s on 2,360 JS/TS files).", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/rust-anything-port-apps-to-rust-and-check-them-against-the-original", "markdown": "https://wpnews.pro/news/rust-anything-port-apps-to-rust-and-check-them-against-the-original.md", "text": "https://wpnews.pro/news/rust-anything-port-apps-to-rust-and-check-them-against-the-original.txt", "jsonld": "https://wpnews.pro/news/rust-anything-port-apps-to-rust-and-check-them-against-the-original.jsonld"}}