<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/we-need-to-talk-about-the-bun-rust-rewrite-txw2n2fil" -->

---
title: We need to talk about the Bun Rust rewrite | daily.dev
description: Bun, the JavaScript runtime originally written in Zig, was rewritten in Rust using Claude AI over just 11 days by Jared Sumner. The rewrite involved 1.78...
canonical: https://daily.dev/posts/we-need-to-talk-about-the-bun-rust-rewrite-txw2n2fil
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: We need to talk about the Bun Rust rewrite | daily.dev
og:description: Bun, the JavaScript runtime originally written in Zig, was rewritten in Rust using Claude AI over just 11 days by Jared Sumner. The rewrite involved 1.78...
og:url: https://daily.dev/posts/we-need-to-talk-about-the-bun-rust-rewrite-txw2n2fil
og:image: https://api.daily.dev/og/posts/TXW2N2FIl.png
og:image:alt: We need to talk about the Bun Rust rewrite
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# We need to talk about the Bun Rust rewrite

**[Theo - t3․gg](https://daily.dev/sources/t3dotgg)** · 60 min read · 2 upvotes · 0 comments

## Summary

Bun, the JavaScript runtime originally written in Zig, was rewritten in Rust using Claude AI over just 11 days by Jared Sumner. The rewrite involved 1.78 million lines of code, 6,500+ commits, and ~$165K in AI API costs — a fraction of what a human team would cost over a year. The process used ~50 dynamic Claude Code workflows running in parallel, adversarial review loops with separate context windows, and a language-independent TypeScript test suite to validate correctness. The result: 128 bugs fixed, memory leaks dramatically reduced, binary size down 20%, and performance up 2-5%. The second half covers Zig creator Andrew Kelley's public response, which the author characterizes as petty, technically confused, and damaging to Zig's reputation — criticizing Kelley for misrepresenting Jared's engineering practices, dismissing Rust's memory safety guarantees, and attacking Bun's VC-backed approach rather than engaging with the technical merits.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=kAjNWanR3n8>

## Questions this post answers

### How did Bun get rewritten from Zig to Rust so quickly using Claude?

Jared Sumner used roughly 50 dynamic workflows in Claude Code running continuously for about 11 days to mechanically port Bun's 500,000-line Zig codebase to Rust, producing over 6,500 commits and 1.78 million lines written or rewritten. The process used a porting guide mapping Zig patterns to Rust patterns, adversarial code review with separate implement and reviewer roles, and continuous test suite validation until 100% of tests passed on all platforms.

_Anyone weighing a large AI-assisted rewrite can compare real workflow strategies like this one on daily.dev._

### What were the concrete improvements after Bun's Rust rewrite compared to the old Zig version?

The Rust rewrite fixed 128 bugs still reproducible in the last Zig release (1.3.14), reduced memory leaks so a build process that previously leaked nearly 7 gigs after 2,000 builds now leaks only about 600 megs, shrank the binary by 20% on Linux and Windows, and made Bun 2 to 5 percent faster, while introducing only 19 regressions.

_Developers deciding whether a Rust rewrite is worth the risk can track real before-and-after numbers like these on daily.dev._

### How much did it cost to rewrite Bun from Zig to Rust using Claude, and why was it considered cheap?

The rewrite consumed 5.9 billion uncached input tokens, 690 million outputs, and 72 billion cached input reads, which would have cost about 165,000 dollars at API pricing. This is considered cheap because a comparable rewrite by three human engineers over a year would have cost roughly 600,000 dollars in salary alone while also freezing all other feature and bug-fix work on Bun for that year.

_Teams estimating the true cost of AI-driven rewrites versus human engineering time can follow cases like this on daily.dev._

## Similar posts on daily.dev

- [Bun rewrite in rust](https://daily.dev/posts/bun-rewrite-in-rust-zff65rp1d) · Medium · 2 upvotes · 1 comments

---

Tags: [#rust](https://daily.dev/tags/rust), [#ai-coding](https://daily.dev/tags/ai-coding), [#claude](https://daily.dev/tags/claude), [#zig](https://daily.dev/tags/zig), [#bun](https://daily.dev/tags/bun)

[View this post on daily.dev](https://daily.dev/posts/we-need-to-talk-about-the-bun-rust-rewrite-txw2n2fil)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"We need to talk about the Bun Rust rewrite","url":"https://daily.dev/posts/we-need-to-talk-about-the-bun-rust-rewrite-txw2n2fil","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/we-need-to-talk-about-the-bun-rust-rewrite-txw2n2fil"},"datePublished":"2026-07-15T04:07:28.340Z","dateModified":"2026-09-13T19:03:05.699Z","description":"Bun, the JavaScript runtime originally written in Zig, was rewritten in Rust using Claude AI over just 11 days by Jared Sumner. The rewrite involved 1.78...","image":"https://i.ytimg.com/vi/kAjNWanR3n8/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/kAjNWanR3n8/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Theo - t3․gg","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Theo - t3․gg","logo":"https://media.daily.dev/image/upload/s--UmX7IyU3--/f_auto/v1704628081/logos/t3dotgg.jpg","url":"https://daily.dev/sources/t3dotgg"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/we-need-to-talk-about-the-bun-rust-rewrite-txw2n2fil","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"rust,ai-coding,claude,zig,bun","timeRequired":"PT60M","video":{"@type":"VideoObject","name":"We need to talk about the Bun Rust rewrite","description":"Bun, the JavaScript runtime originally written in Zig, was rewritten in Rust using Claude AI over just 11 days by Jared Sumner. The rewrite involved 1.78...","thumbnailUrl":"https://i.ytimg.com/vi/kAjNWanR3n8/sddefault.jpg","uploadDate":"2026-07-15T04:07:28.340Z","duration":"PT60M","url":"https://api.daily.dev/r/TXW2N2FIl","embedUrl":"https://www.youtube.com/embed/kAjNWanR3n8"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Theo - t3․gg","item":"https://daily.dev/sources/t3dotgg"},{"@type":"ListItem","position":3,"name":"We need to talk about the Bun Rust rewrite"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/we-need-to-talk-about-the-bun-rust-rewrite-txw2n2fil#faq","mainEntity":[{"@type":"Question","name":"How did Bun get rewritten from Zig to Rust so quickly using Claude?","acceptedAnswer":{"@type":"Answer","text":"Jared Sumner used roughly 50 dynamic workflows in Claude Code running continuously for about 11 days to mechanically port Bun's 500,000-line Zig codebase to Rust, producing over 6,500 commits and 1.78 million lines written or rewritten. The process used a porting guide mapping Zig patterns to Rust patterns, adversarial code review with separate implement and reviewer roles, and continuous test suite validation until 100% of tests passed on all platforms. Anyone weighing a large AI-assisted rewrite can compare real workflow strategies like this one on daily.dev."}},{"@type":"Question","name":"What were the concrete improvements after Bun's Rust rewrite compared to the old Zig version?","acceptedAnswer":{"@type":"Answer","text":"The Rust rewrite fixed 128 bugs still reproducible in the last Zig release (1.3.14), reduced memory leaks so a build process that previously leaked nearly 7 gigs after 2,000 builds now leaks only about 600 megs, shrank the binary by 20% on Linux and Windows, and made Bun 2 to 5 percent faster, while introducing only 19 regressions. Developers deciding whether a Rust rewrite is worth the risk can track real before-and-after numbers like these on daily.dev."}},{"@type":"Question","name":"How much did it cost to rewrite Bun from Zig to Rust using Claude, and why was it considered cheap?","acceptedAnswer":{"@type":"Answer","text":"The rewrite consumed 5.9 billion uncached input tokens, 690 million outputs, and 72 billion cached input reads, which would have cost about 165,000 dollars at API pricing. This is considered cheap because a comparable rewrite by three human engineers over a year would have cost roughly 600,000 dollars in salary alone while also freezing all other feature and bug-fix work on Bun for that year. Teams estimating the true cost of AI-driven rewrites versus human engineering time can follow cases like this on daily.dev."}}]}
```

