v0.2.0 Β· cargo check is the oracle

Translate any app to Rust.

Drop in a Python, Go, TypeScript, Java, C, C++, C#, or Ruby project β€” get back a Cargo crate that mirrors your structure, types, and logic. The LLM generates; the compiler judges. So the result is verified, not vibes.

$ curl -fsSL https://raw.githubusercontent.com/New1Direction/rustyfi/main/install.sh | sh
01

The compiler does the grading β€” and the numbers move

prompt-cache Β· a real 23-file Go service Β· cargo check errors remaining
first cut Β· naive fix loop
117
+ rustfix + reasoner
42
+ contract validation
15
+ context-enriched fixes
4

Every step is a deterministic or compiler-grounded improvement β€” not a prompt tweak. Each number is what cargo check actually reported.

pure-logic projects
0

errors — drop it, build it, run it. Clean Go→Rust on the bundled calculator example.

zero-token repairs
200+

errors fixed by applying rustc's own machine-applicable suggestions, before the model spends a token.

honest exit codes
0Β·1Β·2

clean / compiles-with-gaps / failed. Scriptable, CI-ready, and never lies about which one you got.

02

One command, honest output

rustyfi ./myapp -o ./myapp-rust
$ rustyfi ./myapp -o ./myapp-rust

  rustyfi πŸŽΊπŸ¦€
β–Έ Analyzing source
β–Έ Scaffolding + pinning type contract
  Β· Compiler-checking the contract before translation…
β–Έ Translating to Rust   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 12/12
β–Έ Verifying with cargo check
  Β· Auto-fixed 37 errors with the compiler's own suggestions (no AI)

  βœ“ compiles clean
  Β· 12 translated from go Β· 18 files Β· 0 todo!() stubs
  β†’ cd ./myapp-rust && cargo run
two interfaces, one engine

CLI or drag-and-drop

  • The CLI β€” scriptable, CI-friendly, exit codes that tell the truth. --deep engages the agentic doctor on stubborn errors.
  • The web UI β€” drop a ZIP, watch it stream, download the crate. Same engine, same honesty.
  • Resumable β€” every phase checkpoints; re-run to continue where an interrupt left off.
  • Any provider β€” any OpenAI-compatible endpoint; cheap model for bulk, strong model for repair.
03

What the compiler already knows, for free

contract phase

Agree on the types before writing bodies

One cheap call per package pins the canonical Rust API β€” then compiles it as a skeleton before fan-out. A structurally broken contract is regenerated, never multiplied into 180 errors across every file. The cheap model with the contract beats the expensive model without it.

rustfix pass

Don't pay an LLM for fixes rustc computed

cargo check emits structured, machine-applicable suggestions for a huge class of errors. Rustyfi applies them directly β€” and tries the "maybe" ones only when they reduce the error count. The compiler is the oracle, so a wrong guess never sticks.

context-enriched repair

Show the fixer what the error names

The fix loop sees the trait the compiler says is unsatisfied, the type defined two modules away, the existing impls, and rustc --explain β€” instead of one file and a bare error string. That's how the trait-bound tail finally shrinks.

the doctor Β· --deep

An agent that grinds against ground truth

For the stubborn last mile, an agentic loop reads, searches, edits, and re-checks the crate until it compiles or the budget caps. Edits are confined to src/ and snapshot-reverted β€” it can never make the crate worse than it found it.

04

Two oracles.

behavioral verification Β· second oracle

The compiler proves it's valid Rust. The second oracle proves it's the same app.

For CLI tools, Rustyfi mines a fixture corpus from the project's README and --help output, captures golden stdout / stderr / exit-code from the original program, then β€” once the translation compiles β€” runs the same inputs against the Rust binary and diffs the results. The original is the ground truth. A passing diff means the same behavior on the tested cases; it's differential testing, not a proof of equivalence. Rustyfi is honest about that distinction.

Artifacts emitted: behavior.yaml (the corpus) and behavior_report.json (per-case pass/fail with diffs). Under --deep, the agentic doctor also repairs behavioral mismatches β€” keeping an edit only when behavior improves and the crate still compiles. A regression in either direction is reverted.

what the compiler can't see

A real divergence, caught

On the bundled calculator example the compiler gave a clean bill of health. The behavioral oracle found a difference the type system is blind to:

behavior_report.json Β· calc Β· divide
# input: 33 / 3
original (Go)   stdout: 11
translated (Rust) stdout: 11.0000000000
# exit codes match Β· stderr empty on both
β†’ FAIL  (stdout differs)
oracle pipeline

How the second oracle runs

  • Mine corpus β€” extract example invocations from README and --help; deduplicate and normalise.
  • Capture golden β€” run each case against the source binary; record stdout, stderr, exit code.
  • Diff Rust target β€” once cargo build succeeds, replay every case and compare byte-for-byte.
  • Emit artifacts β€” behavior.yaml and behavior_report.json; piped into CI or read by the doctor.
  • --deep repair β€” agentic doctor targets only failing cases; edits kept only when diff improves and still compiles.
now reaching libraries Β· new

Most real targets are libraries. The second oracle now reaches them.

A library has no CLI to diff. So Rustyfi synthesizes a thin driver that exercises the public API in both the source language and Rust, then diffs the output β€” turning a library into a comparable program. On itsdangerous, the translated Signer verified byte-identical to Python across sign, unsign, and tamper-rejection β€” both drivers model-generated, the diff normalized for harmless language reprs (Python True vs Rust true).

It ships today as a verified engine capability; auto-wiring it into every library translation is gated behind a flag while it hardens (it costs a model call per run). It is honest by construction β€” when it can't synthesize a runnable driver it skips rather than inventing a false mismatch.

05

The honest version

Translating real software between languages is not a solved problem, and Rustyfi doesn't pretend otherwise. Pure-logic projects β€” CLIs, libraries, parsers, algorithms β€” usually come out compiling clean: drop them, build them, run them. Complex real-world apps β€” framework-heavy, native-library-bound β€” come out as a compiling skeleton with your modules wired up and the type-chaos eliminated, plus an honest NEXT_STEPS.md punch-list of what's left.

What no tool can do β€” including this one β€” is take an arbitrary framework-heavy app and emit clean idiomatic Rust with zero human follow-up. Closing that last mile means mapping one ecosystem's semantics onto another's, which needs a human or a stronger model in the loop. Rustyfi gets you most of the way and is honest about the rest. The result banner and exit code never lie about which outcome you got.