rust-anything logo

rust-anything

Visit

rust-anything is an MIT CLI, MCP server, and agent workflow for incrementally rewriting apps in Rust while checking recorded behavior.

Share:
View alternatives

rust-anything

rust-anything is an MIT-licensed CLI, MCP server, and agent workflow for moving an existing application to Rust without treating a rewrite as a blind translation exercise. It records how the original TypeScript, JavaScript, Python, C, Go, Ruby, Java, or Kotlin code behaves, then compares the Rust port against those recordings before a component is accepted. The project can register itself with Claude Code, Codex, Cursor, Gemini CLI, and OpenCode through rust-anything setup.

It fits teams that already have a working application and want to move an expensive path, a library unit, a CLI, or eventually a whole server to Rust. It is not an AI code generator. Your coding agent or developer writes the Rust implementation; rust-anything provides profiling, a generated bridge, recorded cases, replay, and a gate for checking the result. Compare Claude Code for the coding-agent host, or Chrome DevTools MCP when the agent needs a live-browser debugging tool instead.

What it does

  • Profile and plan: identify a workload or hot path before deciding what is worth porting.
  • Record, build, and diff: generate cases against the original, build the Rust crate, and replay the cases against both implementations.
  • Keep callers stable: bridge creates an integration path so a gradual Rust port can retain the original API shape.
  • Expose an agent interface: the CLI can install its MCP server and workflow skill for supported coding agents.
  • Track a whole migration: map, gate, and whole-app recording help show which parts are still original code or have stale recordings.

Practical workflow

  1. Work on a disposable copy of a project, a test database, and non-production credentials.
  2. Install with cargo install rust-anything, then run rust-anything setup if you want the supported agent integrations.
  3. Profile the project, choose one bounded hot path, create a bridge, and record behavior from real tests or chosen inputs.
  4. Implement the Rust unit, then run diff, bench, and gate before widening the scope.

The software is free under MIT; the cost is the Rust toolchain, CI time, and any model usage from the coding agent you choose. The upstream v2.0 release documents case studies for Prettier, json-server, Fuse.js, and vercel/ms, but those results are project-maintainer measurements on particular workloads, not a promise for another codebase.

Important limitation

Recording runs the original program repeatedly. The upstream warning says generated inputs may write files, contact a database, or make network calls. Run it against an isolated copy with test services and no production secrets. Recorded behavior can only cover exercised paths, so a passing diff is evidence for the recorded cases, not proof that every production behavior was preserved.

FAQ

Does it automatically translate an app to Rust?

No. It helps a developer or coding agent choose, implement, and verify a port. The Rust code remains your responsibility.

Can it be used with Codex?

Yes. The upstream setup command lists Codex among the agents for which it can add an MCP server and workflow skill. Review any changes to local agent configuration before running setup.

What should I use instead?

Use a normal profiler and focused refactor when you do not need cross-language behavior replay. Use Claude Code when you first need an agent host rather than a Rust-migration verification layer.

Conclusion

rust-anything is most useful when a measured performance or deployment reason justifies incremental Rust adoption and behavior preservation matters. Start with one isolated component, retain the recordings in review, and treat its benchmark reports as a starting point for your own measurement.

Comments

No comments yet. Be the first to comment!