Skip to content

rust-anything checks a Rust port against recorded behaviour

A one-day-old GitHub project records what your existing app does, then replays that recording against every piece of the Rust rewrite before letting it ship.

Draftship Editorial3 min read

On 2026-11-17, a repository called rust-anything appeared on GitHub trending with 602 stars and 36 forks, gathered in the one day since it was created on 2026-11-16. It is a Rust rewrite tool with a narrow, deliberate scope: it does not convert your code. It records what the existing app does, then checks each piece of the Rust port against that recording before moving on. The main language is Rust and the licence is MIT.

What the repository confirms

The project's README says it handles CLIs, HTTP servers and libraries written in TypeScript/JavaScript, Python, C, Go, Ruby and Java. For each language it generates a bridge so the rest of the codebase keeps calling the same API: napi-rs or wasm-bindgen for TypeScript and JavaScript, PyO3 (abi3) for Python, extern "C" functions with a header for C, typed cgo calls for Go, a magnus extension for Ruby and typed JNI wrappers for Java. Every language except C also gets batch classes through --batch, which keeps many parameter values inside Rust so they cross the boundary once. Language is detected from go.mod, pom.xml, pyproject.toml, Gemfile or package.json, with --lang as an override. The README states the project is independent and not affiliated with or endorsed by the Rust Project or the Rust Foundation.

The loop: record, replay, gate

Install with cargo install rust-anything, or npm install -g rust-anything for JavaScript projects, or a prebuilt binary for macOS, Linux or Windows from the releases. rust-anything setup registers an MCP server and a workflow skill with Claude Code, Codex, Cursor and Gemini CLI, saves a .rust-anything.bak copy beside any file it changes, and can be undone with --remove.

The commands follow a sequence: profile, analyze, bridge, record, build, diff, bench, shadow, gate. record runs the original on generated edge cases (non-ASCII, emoji, -0, NaN, integers where floats are expected) plus semantic traps such as string case, signed division, overflow and sort order, and saves cases.jsonl. diff replays those cases against the Rust. shadow runs both and returns the original's result, switched by RUST_ANYTHING_MODE=old|shadow|new. gate runs fmt, clippy with -D warnings, tests, an unsafe audit, checks that nothing is unported, requires a recorded failing case for every error path, and blocks unwrap, expect or panic! where the original returns an error unless the line is marked // INFALLIBLE.

The numbers the project publishes

The README lists six benchmarks, each measured on 4 cores with a check that results are identical: TypeScript sidebar search over 50,000 keys went from 10 ms to 0.5 ms (20x); the same search in wasm on one thread from 10 ms to 0.95 ms (11.5x); Python slugify over 20,000 strings 98 ms (17x faster); Ruby Shellwords.shellescape over 50,000 values 88 ms (11.8x); Go Slugify over 50,000 strings 49 ms (4x); Java slugify over 50,000 strings 43 ms (3x). The README also warns that calling Rust once per small function is usually slower than a JIT, which is why the tool hunts for loops worth moving rather than individual calls.

Limits and open questions

The README is explicit that a port can only be proven to the extent the recording covers it, and points to a "What it can't catch" section that the announcement text does not include. The tool writes no Rust itself: your coding agent or you do that, so output quality depends on the agent. All six benchmarks come from the project's own demo/ directory, and the header claim of 38,251 recorded cases replayed with 0 mismatches is not tied in the text to a named application. At one day old, the repository has no independent verification yet.

What this means for AI-assisted development

The interesting part is not the speed table. It is the split of work: agents are now good enough to write a Rust module but cannot guess how the original behaves on an emoji, a negative zero or a signed division edge. A tool that supplies the recording, the diff and the gate turns an open-ended rewrite into something checkable step by step. If you build apps with AI and later want to take the code elsewhere, Draftship's paid plans include source code access and GitHub push, documented under GitHub and Vercel. Draftship has no connection to rust-anything.

Primary sources

This article was drafted with AI assistance from the primary sources listed below and checked automatically against them. An editor hasn't reviewed it yet.