Theo Ported TypeScript to Rust with AI and Never Read the Code
Description and use
A large TypeScript compiler was ported to Rust using LLMs, costing $420k in tokens; switching to a newer model produced a fully compatible compiler for $24k, achieving a 13× speedup over the original, though Bun’s checker was faster.
Problem
Can a large compiler be ported by AI without human code review, and what are the cost and performance implications?
Outcome
An LLM‑generated Rust port of TypeScript achieved full compatibility for $24k, delivering a 13× speedup over the original compiler, but was outperformed by Bun’s checker. The high initial cost ($420k) and lack of code review highlight risks of agent‑written code.
Workflow
- 1. Theo used OpenAI models over five months, generating 1.3M lines of Rust code and spending ~$420k in tokens.
- 2. The generated code reached ~84% compatibility but was deemed unusable.
- 3. Theo switched to the Opus model, which produced a working Rust crate in 10 hours for ~$24k.
- 4. The new tsc-rs implementation was benchmarked against tsc 6, tsc 7, and bun check.
- 5. Theo published performance results and a warning that he had not read the code.
- 6. The community compared tsc-rs to bun check and tsc 7, noting trade‑offs in speed and diagnostics.
Evidence
The port cost over $420,000 in API tokens. Then he says you could probably have done it for $20k.
On VS Code, a full type check runs in 4.20s against tsc 6's 54.56s. That is a 13x speedup.
He spent about $400,000 in tokens over five months using OpenAI models, burning through /goal loops. They wrote over 1.3 million lines of Rust and never got past roughly 84% compatibility.
The final spend was about $24,000 over two weeks.
On VS Code, bun check runs a full check in 1.62s. That is 33.7x faster than tsc 6, on a 3.75 million line codebase.
- Record date: 2026-10-07T15:55:50.902Z