YouTube Summaries

← All summaries

On Bun's rewrite from Zig to Rust

2026-05-12 Tue ⏱ 27 min @t3dotgg

Theo covers Bun's audacious rewrite from Zig to Rust, reportedly pulled off in about a week using parallel AI agents (Mythos/Claude). Jared Sumner claims 99.8% of Bun's pre-existing test suites pass on Linux x64 glibc in the Rust port. Theo frames it as both a vote of no-confidence in Zig and the most public AI-driven rewrite to date.

Context: why Bun is bleeding mindshare

  • Dax (OpenCode) moved off Bun to Node.js — cited Windows stability, Electron compat, and uncertainty about Bun's future.
  • William Johnson's "I am worried about Bun" article echoes the same unease: Bun is the biggest relevant Zig project, but the Bun/Zig community relationship is strained.
  • Theo says he's been a longtime supporter but recently finds Bun harder to actually use.

The rewrite

  • Started as a "can agents do this in parallel?" experiment, escalated into a serious port.
  • Anthropic-acquired team has Mythos access — they can run agent loops cheaply, so a lot of the Rust code is likely AI-authored.
  • Migration pipeline is a learnable artifact in itself: how they shard, verify against the existing test suite, and ratchet pass rates.
  • 13,000 unsafe calls in the Rust port — non-trivial surface for memory bugs.

Open problems Jared is publicly wrestling with

  • Rust traits cost at runtime; no Zig-style comptime primitive.
  • He's experimenting with a macro that emits extern decls per type, single codegen unit, full LTO, no shared libs — relying on the linker to inline. Calls it "uncommon and messy," asking Rust experts for better patterns.
  • Compile times will hurt; breaking into crates helps but cyclic deps and lack of comptime are unsolved.

Theo's read

  • AI agents still can't crack top-tier low-level problems unaided — the sparse replies on Jared's deep technical posts prove the knowledge is niche.
  • Jared has publicly committed: no merge unless the Rust port beats Zig on perf, memory, and stability. Theo trusts him on this despite past frustration with Anthropic.
  • Compares scale to the TypeScript→Go port (~1 year of work, much of it pre-public). Bun swapping its implementation language in under a month would be genuinely groundbreaking.
  • Bottom line: probably ships, probably has rough edges, definitely worth watching as a case study in AI-assisted migration.