You Don't Need to Rewrite Your App in Rust—Just the Slow Parts
You've probably heard the advice a hundred times: if your app is slow, rewrite it in Rust. Then you look at your codebase, think about months of porting work, minute-long compile times, and gigabytes of target/ directories, and quietly close the tab. But here's the thing—most of your runtime probably lives in a handful of functions anyway. fast-anything is built around that idea: find the slow functions, port only those to Rust, prove the port behaves identically, and swap it in.
What It Does
fast-anything is a command-line tool that profiles your running application, ranks its functions by time spent and how portable they are, and then helps your coding agent port only the worst offenders to Rust. It's distributed as an npm package (@el4cteo/fast-anything) or a Rust crate, and it works across a wide range of runtimes: Python, Node, TypeScript, Ruby, Java, Kotlin, Go, PHP, C, C++, C#, and R.
The workflow is deliberately staged. A scan command profiles your app. port records up to 500 real calls and generates a one-function Rust crate plus a TASK.md file for your agent. verify release-builds the port and replays every recorded call against it. Then enable or disable swaps the Rust in or out—the swap is a single marked block that gets removed byte for byte, so it's fully reversible. There are also bench, report, and doctor commands for timing, generating a PR-ready markdown and SVG card, and checking your toolchain. It ships as a Claude Code plugin and an MCP server, and --agent accepts claude, codex, or any command that reads a prompt on stdin.
Why It's Cool
-
Verification is the whole point, not an afterthought. The README's demo shows a port that looked correct but compared bytes instead of characters—and 148 of 500 recorded calls caught it. That's the kind of bug that would sail through code review and break in production.
-
It doesn't stop at recorded calls. Beyond replaying real invocations, it derives extra test cases and lets your original code answer them: edge cases like NaN, ±infinity, -0.0, zero and ±1, non-ASCII text, empty inputs, and inputs up to 16× bigger, plus shrunk inputs (tiny and random slices). Nothing gets enabled until every case matches—same values (floats within 1e-9), and errors exactly where the original errors.
-
It accounts for the cost of the boundary. A port that's correct but slower per call than the original—because calling into Rust costs more than the work saved—isn't enabled either. That's an honest detail you don't often see in performance tooling.
-
Reversibility is designed in. The enable/disable mechanism is a single marked block removed byte for byte, and
FAST_ANYTHING_DISABLE=1runs the original. You're never locked in. -
It meets you where you are. Rather than demanding a specific agent,
--agenttakes any command that reads a prompt on stdin. No agent at all? HandTASK.mdto whatever you use.
How to Try It
- Install it globally via npm (or cargo):
npm i -g @el4cteo/fast-anything # or: cargo install fast-anything
Ports are compiled with your Rust toolchain, so you'll need rustup set up.
- Run the whole pipeline in one command against your app:
fast-anything go --agent claude -- python app.py
You can swap in -- node app.ts, -- bun app.ts, -- deno run -A app.ts, -- ruby app.rb, -- java App.java, -- mvn exec:java, -- gradle run, -- go run ., -- php app.php, -- clang -O2 main.c, or -- Rscript app.R.
- Or go step by step:
scan -- <cmd>to profile,port [id]to record calls and generate the crate,verifyto replay, thenenable,bench, andreportas needed.doctorchecks that Rust, your runtimes, and your agents are all in place.
Full details are in the repository.
Final Thoughts
fast-anything isn't trying to convince you to rewrite everything—it's betting that you don't need to. The combination of profiling, agent-assisted porting, and rigorous replay verification makes the "just port the slow 5%" advice actually practical rather than aspirational. It's best suited to teams with a real performance bottleneck in a supported language who want measurable gains without a months-long migration. If that sounds like your situation, the one-command entry point makes it easy to find out whether it works for you.