Fireship · @fireship
The most controversial rewrite in history just shipped...
Uploaded July 15, 2026 · Length 5:52
Summary
Bun rewrote its entire codebase from Zig to Rust using AI, fixing bugs and improving performance, sparking controversy with Zig's creator.
- bun zig rust rewrite
- ai code generation
- memory management bugs
- programming language controversy
- anthropic claude ai
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
Last week, Bun, the all-in-one
- 0:02
JavaScript toolkit that was acquired by
- 0:04
Anthropic late last year, announced that
- 0:06
they spent the equivalent of $165,000
- 0:09
running 64 parallel clot agents to
- 0:12
refactor their entire codebase from Zigg
- 0:14
to Rust in just 11 days. Usually, a full
- 0:17
rewrite to Rust is the swan song of any
- 0:20
startup about to get Rick James by the
- 0:21
invisible hand of the market, but in
- 0:23
this case, it may have actually worked.
- 0:25
The millionline port fixed 128 old bugs,
- 0:28
shrunk the binary by 20%, made
- 0:30
everything a few% faster, and has
- 0:32
already been powering Claude code since
- 0:34
June without anyone noticing. But not
- 0:36
everyone is celebrating. Andrew Kelly,
- 0:38
the creator of Zigg, responded claiming
- 0:41
the benchmarks are misleading, and the
- 0:42
Zig team is actually relieved to see Bun
- 0:45
go because internally they used its
- 0:46
codebase as an example of how not to
- 0:48
write Zigg and that Jared, Bun's
- 0:50
founder, was producing SLOP long before
- 0:53
LLM existed. In today's video, we'll
- 0:55
find out how the biggest AI powered
- 0:57
rewrite in history actually went down
- 0:59
and decide who should get custody of
- 1:00
public opinion in the divorce. It is
- 1:02
July 15th, 2026, and you're watching the
- 1:05
code report. That 26 years ago, when I
- 1:07
was throwing Japan airs in the
- 1:08
warehouse, Joel Spolski wrote one of the
- 1:10
most famous blog posts in software
- 1:12
history where he claimed that rewriting
- 1:14
your codebase is the single worst
- 1:15
strategic mistake a software company can
- 1:17
make. His example was Netscape, who
- 1:19
spent three years rewriting their
- 1:21
browser while Microsoft stole their
- 1:22
women and pillaged their village. So,
- 1:24
what led Bun to fall to the temptation
- 1:26
of the single word strategic mistake
- 1:28
they could make? Well, it's actually the
- 1:30
same thing that led you to fail CS 101,
- 1:32
switch majors, and become a JavaScript
- 1:34
developer, but poor memory management.
- 1:36
With Zigg, the language Bun was
- 1:38
originally written in, you manually
- 1:40
manage memory yourself without much help
- 1:42
from the compiler. That's usually a
- 1:43
feature of a low-level language because
- 1:45
Bun embeds JavaScript core, which is
- 1:47
Safari's garbage collected JavaScript
- 1:49
engine. Half of Bun's objects were owned
- 1:51
by the garbage collector, while the
- 1:53
other half lived in manually managed Zig
- 1:55
memory, and the two had to constantly
- 1:57
manage pointers to each other, which led
- 1:59
to a codebase that looked like it had an


