Rewrite your app in Rust, piece by piece, checked against the original at every step. Works with TypeScript, JavaScript, Python, Go, Ruby, Java, C, PHP, C#, Kotlin, PowerShell and Swift.
Rust agent-skillsclaude-codeclicode-migrationcodexffigolangjavajavascriptmcpmigrationnapiperformanceportingpyo3pythonrewriterubyrusttypescript
README: context-mode layout, results table, sponsors at the bottom
Erkam Yaman6a04ac6915bd
diff --git a/README.md b/README.mdindex e5d311f2..9bcbd63e 100644--- a/README.md+++ b/README.md@@ -1,90 +1,46 @@-<p align="center">- <a href="https://rustanything.ai/">- <img src="docs/assets/logo.png" width="140" height="140" alt="The Rust Anything crab">- </a>-</p>+# Rust Anything-<h1 align="center">Rust Anything</h1>+**Port your app to Rust with your coding agent, and prove the port still behaves the same. Free and open source, runs on your machine, no account.**-<p align="center"><a href="https://crates.io/crates/rust-anything"><img src="https://img.shields.io/crates/v/rust-anything?style=flat&colorA=111111&colorB=b34a1a&label=crates.io" alt="crates.io version"></a><a href="https://www.npmjs.com/package/rust-anything"><img src="https://img.shields.io/npm/v/rust-anything?style=flat&colorA=111111&colorB=b34a1a&label=npm" alt="npm version"></a><a href="https://github.com/erkamyaman/rust-anything/stargazers"><img src="https://img.shields.io/github/stars/erkamyaman/rust-anything?style=flat&colorA=111111&colorB=b34a1a&label=stars" alt="GitHub stars"></a><a href="https://discord.gg/FXhUEA8eBR"><img src="https://img.shields.io/badge/discord-join-111111?style=flat&colorA=111111&colorB=b34a1a" alt="Discord"></a>-<a href="#license"><img src="https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-111111?style=flat&colorA=111111&colorB=b34a1a" alt="MIT or Apache-2.0 license"></a><br>+<a href="#license"><img src="https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-111111?style=flat&colorA=111111&colorB=b34a1a" alt="MIT or Apache-2.0 license"></a><a href="https://rustanything.ai/"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Frustanything.ai%2Fbadge-downloads.json&style=flat" alt="Total downloads, crates.io and npm"></a><a href="https://crates.io/crates/rust-anything"><img src="https://img.shields.io/crates/d/rust-anything?style=flat&colorA=111111&colorB=b34a1a&label=crates.io%20downloads" alt="crates.io downloads"></a><a href="https://www.npmjs.com/package/rust-anything"><img src="https://img.shields.io/npm/d18m/rust-anything?style=flat&colorA=111111&colorB=b34a1a&label=npm%20downloads" alt="npm downloads"></a>-</p>--<p align="center">-Migrate your app to Rust, and check it still behaves the same.-</p>-<p align="center">🚀 <b>Rust Anything is live on Product Hunt today.</b> If it saved you a rewrite, <a href="https://www.producthunt.com/products/rust-anything?launch=rust-anything">come say hi</a>.</p>+**13.8K GitHub stars · 1.1K forks · 86 contributors** (read 2026-12-04) · #1 Rust repository of the day and the week on Trendshift · live on [Product Hunt](https://www.producthunt.com/products/rust-anything?launch=rust-anything) today-<p align="center">-<a href="https://trendshift.io/repositories/363468" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/363468/daily?language=Rust" alt="erkamyaman/rust-anything: #1 Rust repository of the day on Trendshift" width="250" height="55"/></a>-<a href="https://trendshift.io/repositories/363468" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/363468/weekly?language=Rust" alt="erkamyaman/rust-anything: #1 Rust repository of the week on Trendshift" width="250" height="55"/></a>-</p>+> Rust Anything has no translator inside. Your coding agent writes the Rust. Rust Anything records what the original code does, replays every recorded case against the port, and only calls the port done when every case matches. [Docs](https://rustanything.ai/)<p align="center">-<b>Documentation:</b> <a href="https://rustanything.ai/">https://rustanything.ai/</a>+ <picture>+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/how-it-works-dark.svg">+ <img src="docs/assets/how-it-works-light.svg" width="880" alt="analyze plans what to port; rust-anything go bridges, records, lets your agent port and gates the result">+ </picture></p>-<p align="center"><a href="docs/translations.md">🌐 Other languages</a></p>--<p align="center">Moving a codebase to Rust? I offer consulting for Rust migrations: <a href="mailto:[email protected]">[email protected]</a></p>+**Contents:** [Why](#why) · [Install](#install) · [Try it](#try-it) · [Results](#results) · [How it works](#how-it-works) · [Languages](#languages) · [Commands](#commands) · [Security and privacy](#security-and-privacy) · [Consulting](#consulting) · [Learn Rust](#learn-rust) · [Sponsors](#sponsors) · [License](#license) · [Community](#community)-## Sponsors--<p align="center">- Made in Türkiye 🇹🇷 by <a href="https://github.com/erkamyaman">erKam Yaman</a><br>- X: <a href="https://x.com/RustAnything">@RustAnything</a> · <a href="https://x.com/erkamyaman_ng">@erkamyaman_ng</a><br>- Rust Anything is free and open source. If it helps your work, sponsoring keeps it going.-</p>+## Why-<p align="center"><sub>Your safety comes first: sponsors get a logo and a link here, and a shout-out on social media. No paid recommendations and no setup guides for third-party AI API resellers, so nothing here steers your code, keys or data somewhere you didn't choose.</sub></p>+Coding agents made rewriting cheap. The hard part is the question after: is the Rust version the same? Same output, same errors, same edge cases.-<p align="center"><sub><b>There is no Rust Anything coin or token.</b> Anyone offering or selling one is not affiliated with this project or with me, so don't trust anything shady or dodgy that uses these names.</sub></p>+- **Done means same behavior, not "it compiles".** `gate` passes only when every recorded case matches, and `cargo fmt`, `clippy`, `cargo test`, an `unsafe` check and a stub check pass.+- **One function at a time.** Callers keep the same API, the rest of the app stays where it is, and `disable` switches back.+- **Whole apps too.** A Rust front door sits in front of a CLI or server and sends each request to Rust or to the original, so the app works at every step.+- **Runs on your machine.** No telemetry and no account. The plan (`analyze`) needs no model and costs no tokens.+- **Checked on real code.** Prettier: 17,224 of 17,224 recorded runs byte-identical. ESLint: 10,585 of 10,585. ffmpeg's libavutil: 226,447 of 226,447 recorded calls. See [Results](#results).<p align="center">- <a href="https://coderabbit.link/er-kam">- <picture>- <source media="(prefers-color-scheme: dark)" srcset="docs/assets/sponsors/company-dark.svg">- <img src="docs/assets/sponsors/company-light.svg" width="800" alt="Company sponsor: CodeRabbit">- </picture>- </a>-</p>--<p align="center">- <a href="https://www.atakdomain.com/">- <picture>- <source media="(prefers-color-scheme: dark)" srcset="docs/assets/sponsors/domain-dark.svg">- <img src="docs/assets/sponsors/domain-light.svg" width="800" alt="Domain sponsor: Atak Domain">- </picture>- </a>-</p>--<p align="center">- <a href="https://github.com/sponsors/erkamyaman">- <picture>- <source media="(prefers-color-scheme: dark)" srcset="docs/assets/sponsors/sponsors-dark.svg">- <img src="docs/assets/sponsors/sponsors-light.svg" width="800" alt="Sponsors: Santosh Yadav, Hakan Soytürk, Ali Yilmaz, Ashley Hunter, Fatih Uzuntaş, bugrcvi, starwish.ing, omerrgoren">- </picture>- </a>+<a href="https://trendshift.io/repositories/363468" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/363468/daily?language=Rust" alt="erkamyaman/rust-anything: #1 Rust repository of the day on Trendshift" width="250" height="55"/></a>+<a href="https://trendshift.io/repositories/363468" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/363468/weekly?language=Rust" alt="erkamyaman/rust-anything: #1 Rust repository of the week on Trendshift" width="250" height="55"/></a></p>-<p align="center">- <a href="https://github.com/sponsors/erkamyaman"><img src="https://img.shields.io/badge/Become_a_sponsor-%E2%9D%A4-db61a2?style=for-the-badge&logo=githubsponsors&logoColor=white" alt="Become a sponsor"></a>- <a href="https://buymeacoffee.com/erkamyaman"><img src="https://img.shields.io/badge/Buy_me_a_coffee-%E2%98%95-FFDD00?style=for-the-badge&logo=buymeacoffee&logoColor=black" alt="Buy me a coffee"></a>-</p>+## Install-<p align="center">Sponsoring as a company, or anything else? <a href="mailto:[email protected]">[email protected]</a></p>--<p align="center">Moving a codebase to Rust? I offer consulting for Rust migrations: <a href="mailto:[email protected]">[email protected]</a></p>--## Quick startPaste this into your coding agent:@@ -110,23 +66,34 @@ sudo apt install ./rust-anything_*_amd64.deb # Debian,nix run github:erkamyaman/rust-anything # Nix```-> [!WARNING]-> Recording runs the original's real code. Work on a copy, and point a server at a test database.-> `record --sandbox` and `app record --sandbox` run it with no network, the repository read-only-> and a CPU limit (sandbox-exec on macOS, bubblewrap on Linux; `doctor` checks for it). There is no-> memory limit on macOS, and the Linux path has not been run yet (see [STATUS](docs/STATUS.md)).+**Agents:** read [rustanything.ai/llms.txt](https://rustanything.ai/llms.txt) for the install steps, every command and the porting workflow.-> [!TIP]-> **Agents:** read [rustanything.ai/llms.txt](https://rustanything.ai/llms.txt) for the install steps, every command and the porting workflow.+## Try it-## How it works+Paste this into your agent after the install, with the command that is slow in your app:-<p align="center">- <picture>- <source media="(prefers-color-scheme: dark)" srcset="docs/assets/how-it-works-dark.svg">- <img src="docs/assets/how-it-works-light.svg" width="880" alt="analyze plans what to port; rust-anything go bridges, records, lets your agent port and gates it, looping until every recorded case matches; enable then switches callers to Rust">- </picture>-</p>+```text+Run rust-anything go -- <slow command of this app> and finish the port until rust-anything gate passes.+```++`go` profiles the workload, picks the hottest function that can be ported, bridges it, records it, hands the port to your agent and gates it. Want the plan first? `rust-anything analyze .` gives a ranked list of what to port and what is risky, with no model and no tokens.++## Results++Real code someone else wrote, run through Rust Anything. Every row links to the full run, with dates, commands and the cases that failed on the way ([all runs](docs/real-world.md)).++| Project | What was ported | Behavior | Speed |+|---|---|---|---|+| [Prettier](docs/real-world.md#prettier) | JS, TS, JSON, GraphQL, YAML, Markdown, CSS, SCSS, Less | 17,224/17,224 byte-identical, 15,861 fully in Rust | CLI on 59 real files: 3.63 s to 0.20 s, **18x** (mostly Node start-up; about 7x per file in process) |+| [ESLint](docs/real-world.md#eslint) | the linter core and 90 rules, behind a Rust front door | 10,585/10,585 byte-identical stdout, stderr and exit code, 10,204 fully in Rust | |+| [ffmpeg libavutil](docs/real-world.md#ffmpeg) | 10 crates of portable C | 226,447/226,447 recorded calls | |+| [json-server](docs/real-world.md#json-server) | the whole server, lifted to a 5.3 MB Rust binary | 514/514 recorded requests | `GET /posts`, 50 connections: 19.7k to 115.0k requests/s |+| [Fuse.js](docs/real-world.md#fusejs) | fuzzy search | 3,414/3,414 | 50,000 strings: **32x** on all cores, 5.3x on one |+| [vercel/ms](docs/real-world.md#vercelms) | `parse`, `format` | 975/975, including 340 calls from its own Jest tests | `parse` x100,000 in a batch: **18x** |++Rust is not automatically faster. A small function called across a bridge one call at a time is often slower than the JIT, and `bench` shows it. Port what is hot, or batch it.++## How it works**What counts as done.** Behavior, not your tests. `record` runs the original on generated and given inputs and saves what each call returns, throws and prints. A port is done when `gate` passes: every recorded case matches (an error must have the original's type; its message text is not compared), and fmt, clippy, `cargo test`, the `unsafe` check, the stub check and the check for recorded answers pasted into the port all pass. Your own tests run too.@@ -197,14 +164,77 @@ nix run github:erkamyaman/rust-anything # Nix| `rust-anything log <repo>` | Every switch on or off, wire, lift and gate result, from `rust/audit.jsonl` || `rust-anything setup` / `doctor` / `mcp` | Install for agents, check runtimes, MCP server |+## Security and privacy++Recording runs the original's real code. Work on a copy, and point a server at a test database.+`record --sandbox` and `app record --sandbox` run it with no network, the repository read-only+and a CPU limit (sandbox-exec on macOS, bubblewrap on Linux; `doctor` checks for it). There is no+memory limit on macOS, and the Linux path has not been run yet (see [STATUS](docs/STATUS.md)).++rust-anything runs on your machine. The CLI, the MCP server and the skill send none of your code, recordings or results anywhere, collect no telemetry, and need no account. What reaches the network is what you or your agent run: Cargo, the package managers your original needs, and the RustSec database when `gate` runs `cargo deny` or `cargo audit`. Details: [Privacy](docs/privacy.md).++## Consulting++Moving a codebase to Rust? I offer consulting for Rust migrations: [[email protected]](mailto:[email protected])+## Learn RustNew to Rust, or coming from another language? [**Rust for Everyone**](book/) is a free beginner book. Every code example in it was compiled and run, and it is written to be read right here on GitHub. It is in English and 14 other languages. The translations are drafts that native speakers are welcome to fix ([how](book/REVIEWING.md)).-PDF: [English](book/en/rust-for-everyone-en.pdf) · [简体中文](book/zh/rust-for-everyone-zh.pdf) · [Español](book/es/rust-for-everyone-es.pdf) · [Türkçe](book/tr/rust-for-everyone-tr.pdf) · [Русский](book/ru/rust-for-everyone-ru.pdf) · [Українська](book/uk/rust-for-everyone-uk.pdf) · [Deutsch](book/de/rust-for-everyone-de.pdf) · [Français](book/fr/rust-for-everyone-fr.pdf) · [日本語](book/ja/rust-for-everyone-ja.pdf) · [한국어](book/ko/rust-for-everyone-ko.pdf) · [Português](book/pt/rust-for-everyone-pt.pdf) · [العربية](book/ar/rust-for-everyone-ar.pdf) · [Tiếng Việt](book/vi/rust-for-everyone-vi.pdf) · [हिन्दी](book/hi/rust-for-everyone-hi.pdf) · [Bahasa Indonesia](book/id/rust-for-everyone-id.pdf) · [all 15 languages](https://rustanything.ai/docs/learn/rust-for-everyone)+## Sponsors++<p align="center">+ Made in Türkiye 🇹🇷 by <a href="https://github.com/erkamyaman">erKam Yaman</a><br>+ X: <a href="https://x.com/RustAnything">@RustAnything</a> · <a href="https://x.com/erkamyaman_ng">@erkamyaman_ng</a><br>+ Rust Anything is free and open source. If it helps your work, sponsoring keeps it going.+</p>++<p align="center"><sub>Your safety comes first: sponsors get a logo and a link here, and a shout-out on social media. No paid recommendations and no setup guides for third-party AI API resellers, so nothing here steers your code, keys or data somewhere you didn't choose.</sub></p>++<p align="center"><sub><b>There is no Rust Anything coin or token.</b> Anyone offering or selling one is not affiliated with this project or with me, so don't trust anything shady or dodgy that uses these names.</sub></p>++<p align="center">+ <a href="https://coderabbit.link/er-kam">+ <picture>+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/sponsors/company-dark.svg">+ <img src="docs/assets/sponsors/company-light.svg" width="800" alt="Company sponsor: CodeRabbit">+ </picture>+ </a>+</p>++<p align="center">+ <a href="https://www.atakdomain.com/">+ <picture>+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/sponsors/domain-dark.svg">+ <img src="docs/assets/sponsors/domain-light.svg" width="800" alt="Domain sponsor: Atak Domain">+ </picture>+ </a>+</p>++<p align="center">+ <a href="https://github.com/sponsors/erkamyaman">+ <picture>+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/sponsors/sponsors-dark.svg">+ <img src="docs/assets/sponsors/sponsors-light.svg" width="800" alt="Sponsors: Santosh Yadav, Hakan Soytürk, Ali Yilmaz, Ashley Hunter, Fatih Uzuntaş, bugrcvi, starwish.ing, omerrgoren">+ </picture>+ </a>+</p>++<p align="center">+ <a href="https://github.com/sponsors/erkamyaman"><img src="https://img.shields.io/badge/Become_a_sponsor-%E2%9D%A4-db61a2?style=for-the-badge&logo=githubsponsors&logoColor=white" alt="Become a sponsor"></a>+ <a href="https://buymeacoffee.com/erkamyaman"><img src="https://img.shields.io/badge/Buy_me_a_coffee-%E2%98%95-FFDD00?style=for-the-badge&logo=buymeacoffee&logoColor=black" alt="Buy me a coffee"></a>+</p>++<p align="center">Sponsoring as a company, or anything else? <a href="mailto:[email protected]">[email protected]</a></p>## LicenseLicensed under either of [MIT](./LICENSE-MIT) or [Apache-2.0](./LICENSE-APACHE), at your option. © [Erkam Yaman](https://github.com/erkamyaman). Ports and generated code in your repository are yours.Unless you explicitly state otherwise, any contribution you intentionally submit for inclusion in rust-anything, as defined in the Apache-2.0 license, is dual licensed as above, without any additional terms or conditions.++## Community++Questions and ideas on [Discord](https://discord.gg/FXhUEA8eBR). Bugs and requests in [issues](https://github.com/erkamyaman/rust-anything/issues); new to the repo? Start with a [good first issue](https://github.com/erkamyaman/rust-anything/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).++Every contributor gets a badge and share cards in their own language: [find yours](https://github.com/erkamyaman/rust-anything/discussions/1508).