Coding

AI agents can write Rust. Should you rewrite your project?

An AI agent can write Rust; that alone is not a reason to rewrite a working service. Start with a narrower question: where does the time or risk actually come…

Oliver · FoxAI World2 min read
18
Oliver beside the Rust symbol and measurement toolsMeasure before Rust

Conceptual cover created with AI.

An AI agent can write Rust; that alone is not a reason to rewrite a working service. Start with a narrower question: where does the time or risk actually come from, and who will maintain the new code?

Compiler feedback helps, but it has limits

Rust can catch many ownership and type errors before a program runs. An agent can use the diagnostic to attempt a repair, creating a useful feedback loop. Compiling does not prove that the program meets its business requirements or is safe in every environment. The Generative Compilation paper studies compiler feedback during generation on specific Rust tasks across seven models; its results should not be treated as a universal guarantee.

Oliver compares compiler feedback and performance
AI-generated conceptual illustration.

What Bun’s migration actually involved

In Bun’s own account, the Zig-to-Rust port was merged after 11 days using parallel agent workflows, an existing test suite and human oversight. The author estimated roughly $165,000 at API prices for the pre-merge model usage. The same account records known regressions that were fixed and continued unsafe code at C/C++ boundaries. Its measured HTTP gains of roughly 3–5% apply to the listed workloads, not every application.

A smaller experiment is often more informative

Profile a representative workload first. If network, database or model response time dominates, reducing local execution time may barely change the user’s wait. Select a small hot path, compare it under the same load and hardware, and test failure cases, security, behavior and rollback alongside speed.

Language choice is a tradeoff: Microsoft’s native TypeScript compiler work uses Go and concurrency. Team knowledge and long-term ownership deserve a place in the decision as much as a microbenchmark.

Sources and research

Written by FoxAI World. The cover and illustrations are AI-generated conceptual artwork.

Your favourites

This list stays in this browser on your device. No account is needed, and other visitors cannot see it.

Use a story’s bookmark button to add your first favourite.