Video summary
Why Everyone's Rewriting Everything in Rust
Main summary
Key takeaways
Summary of technological concepts, product features, and analysis
- Rust adoption accelerates despite no major language changes: The video argues that Rust itself “didn’t fundamentally change,” yet many large companies switched or rewrote toward Rust in roughly the last 12 months. The implied driver is lower cost and faster iteration enabled by AI-assisted porting, rather than Rust becoming dramatically better this year.
Bun (Zig → Rust) rewrite enabled by AI + compiler feedback
What happened
- Bun’s creator Jared used AI (Claude) to port Bun’s large Zig codebase to Rust as an experiment.
- The result was merged, and Bun fully shifted away from Zig.
Stability and performance outcomes (before/after cleanup)
- The raw port passed Bun’s entire test suite early, even before extensive refactoring.
- It reduced memory issues, including fixed memory leaks and fewer flaky tests.
- It became smaller and faster than the prior Zig version.
Why errors changed
- Bun integrates JavaScript behavior.
- Zig’s manual memory handling can clash with JavaScript’s GC expectations, leading to issues like:
- heap-use-after-free
- memory leaks
- race conditions
- Rust’s model (and especially compiler checks) prevented many defects from reaching production.
Key technical point
- The video claims Rust would catch many bug classes as compile-time errors rather than runtime failures.
Scale challenge
- Bun reportedly has ~535,000 lines of Zig, making a straightforward “hand rewrite” impractical without significant engineering headcount and time.
AI-assisted approach
- Instead of hiring a full rewrite team, they leveraged AI’s ability to iterate across large code changes.
- The video references Claude on an unreleased “Fable 5”-type capability described as excellent at looping over code until completion.
- The workflow is compared to a human team:
- AI does bulk work
- humans refine tricky areas (e.g.,
unsafeblocks and allocation patterns)
Smart pointer idea (and why they didn’t do the “classic” approach)
- The video notes an initial thought: adding Rust-inspired smart pointers to Bun’s Zig code to improve safety/stability.
- It was described as:
- worse ergonomically, and
- lacking Rust’s stronger guarantees
- This made AI-enabled rewriting the practical path once AI reduced time and cost.
Cost and timeline comparison to human-only rewrites
- The Bun port reportedly cost $165,000 in API pricing over ~11 days.
- Jared estimates a human-only effort would require:
- 3 engineers with full context for ~1 year
- The video also compares other rewrites:
- Dropbox sync engine: ~4 years, ~6 engineers, with a more complex architectural change
- TypeScript → Go (Go port): ~2 years with ~5–8 engineers
Industry pattern: other major ports/rewrites driven by AI feasibility
Meta / Flow (OCaml → Rust)
- Flow is a JavaScript type checker originally written in OCaml (GC language).
- Historically, the team shelved Rust due to port cost, but in the AI era they did the Rust port.
- Reported impact:
- ~2× general performance increase
- up to 100% faster execution on heavy workloads
- Early issues:
- initial Rust version failed tests
- was slower until humans adjusted allocation patterns
Meta ongoing Rust migration
- React compiler: TypeScript → Rust (merged after starting as an experiment)
- Rewriting decades-old C code in core messaging libraries into Rust
Dependency-level gains without full rewrites
- Linear: a build tool change where Vite 8 replaced a bundler with rollup (Rust) → production build time 46s to 6s
- Other reported build-time reductions:
- Ramp (-57%)
- Mercedes-Benz (up to -38%)
- Beehive (-64%)
- Takeaway: sometimes swapping Rust-based dependencies yields major wins with lower risk than a full migration.
Longevity and long-term concerns
- The video cautions that AI-driven rewrites can have social and organizational implications as well (referencing layoffs vs later rehiring).
- The implication is that “AI only” narratives may not reflect true causes, and long-term outcomes remain uncertain.
Status of earlier Rust-in-Linux efforts
- Linux kernel: the “Rust experiment” concluded (December, per maintainers summit), with Rust described as “here to stay” in the kernel.
- A Rust feature/type proposal called “untrusted” is mentioned as potentially eliminating ~80% of CVEs the kernel generates (as presented by Greg Kroah-Hartman).
More examples of Rust moving into critical infrastructure
- Microsoft: Rust used in parts of their stack, including Windows kernel (per the video).
- Cloudflare: replaced an Nginx-based core proxy with a Rust-based FL2, improving median site performance by ~10ms.
- AI labs / tooling rewritten or built in Rust (as described):
- OpenAI Codex CLI (TypeScript → Rust)
- Astro/UV/Ruff Rust tooling acquisition context (implying Rust tooling strength and integration reasons)
- “SpaceX AI”/Grok build CLI described as Rust-based
- plus a note about a security/privacy incident involving auto-uploading a repo to a cloud bucket, later backtracked/deleted
Why Rust + AI is a particularly good match (compiler-assisted loops)
- A highlighted mechanism: Rust compilation produces rich, structured errors.
- Example claim from the Bun port:
- at ~16,000 compiler errors, they used 64 Claude agents
- the agents looped over
cargo checkovernight, autonomously fixing errors file-by-file
- Core idea: the compiler becomes the feedback channel that guides AI iteration until errors are eliminated.
Not every project should switch (tradeoffs and fit)
- The video includes a caveat via Mitchell Hashimoto (Ghosty creator):
- he evaluated Rust but chose Zig for personal/ergonomic reasons (he “wasn’t having fun” reading/writing Rust)
- technical reasons also include:
- C interoperability
- preference for explicit memory management
- The video contrasts Bun’s situation (many permanent
unsafeblocks) with cases where Rust’s guarantees may not align with project needs. - Bottom line: Rust momentum is real, but Rust isn’t a universal replacement—the changing factor is porting cost.
Product / tool highlight from the video
Cursor (sponsored) for AI-assisted coding tasks
- The video claims Cursor’s cloud agents can delegate large engineering tasks to remote environments that include:
- required tools/dependencies/context
- the ability to build, test, and debug autonomously
- returning videos, screenshots, logs, and test results for verification
- Discussed platforms:
- desktop (with the ability to close the laptop)
- mobile app
- iPad app launch
- Positioning: “harness matters” (which AI model and workflow setup), and Cursor is described as using AI models effectively.
Main speakers / sources (as mentioned)
- Jared (founder of Bun)
- Claude / Claude agents (Anthropic models used for rewriting; video references “Fable 5”)
- Mitchell Hashimoto (Ghosty / Zig perspective)
- Greg Kroah-Hartman (Linux kernel maintainer; “untrusted” Rust type talk)
- Linus Torvalds (referenced indirectly regarding attitudes toward Rust)
- Cursor team / Cursor product (sponsor)
Rate this summary
Your feedback will help improve summaries.
Improve this summary
Reprocess with a stronger model when the summary feels incomplete or inaccurate.
Translate summary in another language
Ask questions to this video
Chat for follow-up questions, clarifications, and source-backed answers.