<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/bun-rewrite-in-rust-zff65rp1d" -->

---
title: Bun rewrite in rust | daily.dev
description: Bun, the JavaScript runtime originally written in Zig, was rewritten in Rust in July 2026. The migration of ~535,000 lines of code was completed in just 11...
canonical: https://daily.dev/posts/bun-rewrite-in-rust-zff65rp1d
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Bun rewrite in rust | daily.dev
og:description: Bun, the JavaScript runtime originally written in Zig, was rewritten in Rust in July 2026. The migration of ~535,000 lines of code was completed in just 11...
og:url: https://daily.dev/posts/bun-rewrite-in-rust-zff65rp1d
og:image: https://api.daily.dev/og/posts/zff65RP1d.png
og:image:alt: Bun rewrite in rust
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.

# Bun rewrite in rust

**[Medium](https://daily.dev/sources/medium_js)** · 4 min read · 2 upvotes · 1 comments

## Summary

Bun, the JavaScript runtime originally written in Zig, was rewritten in Rust in July 2026. The migration of ~535,000 lines of code was completed in just 11 days using 64 parallel Claude agents via Claude Code, at an estimated cost of $165,000 in API usage. Key motivations included memory safety issues in the Zig codebase, a larger Rust contributor ecosystem, and Anthropic's infrastructure needs after acquiring Bun in December 2025. The rewrite passed 100% of Bun's TypeScript test suite. Zig creator Andrew Kelley criticized the move, arguing bugs stemmed from rushed engineering rather than Zig's limitations, and critics raised concerns about unreviewed AI-generated code in core infrastructure.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://rajeshkumartech.medium.com/bun-rewrite-in-rust-a328a51f2734>

## Questions this post answers

### Did Bun switch from Zig to Rust?

Bun was reportedly rewritten entirely from Zig to Rust in July 2026, migrating roughly 535,000 lines of code in 11 days using 64 parallel Claude Code agents. The effort reportedly cost about $165,000 in Claude API usage, reached 1,300 lines per minute at peak, and passed Bun's full TypeScript test suite. Reasons cited include memory safety issues in Zig and a larger Rust contributor pool.

_Track fast-moving runtime changes like this Bun migration story on daily.dev before you plan an upgrade._

### Why did Bun move away from Zig?

Bun's creator cited memory management bugs such as use-after-free and double-free errors in Zig, along with Rust's compiler-enforced lifetime tracking and RAII-based cleanup as safety improvements. A larger Rust contributor ecosystem was also cited as easing bug fixes and community maintenance compared to Zig's smaller pool of developers.

_Developers weighing Zig against Rust for systems work can follow this debate on daily.dev._

### Was Bun acquired by Anthropic?

Bun was reportedly acquired by Anthropic on December 2, 2025, because Anthropic's Claude Code coding tool relies heavily on Bun's runtime, package manager, and bundler to compile and distribute standalone executables to millions of users.

_Keep up with Claude Code's underlying tooling changes on daily.dev as they affect your workflow._

## Community discussion

Top comments from developers on daily.dev.

**@khauma** · 0 upvotes

> This article was hard to read.

---

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

[View this post on daily.dev](https://daily.dev/posts/bun-rewrite-in-rust-zff65rp1d)

```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":"Bun rewrite in rust","url":"https://daily.dev/posts/bun-rewrite-in-rust-zff65rp1d","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/bun-rewrite-in-rust-zff65rp1d"},"datePublished":"2026-07-20T07:29:35.851Z","dateModified":"2026-09-13T19:15:19.904Z","description":"Bun, the JavaScript runtime originally written in Zig, was rewritten in Rust in July 2026. The migration of ~535,000 lines of code was completed in just 11...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c6d2d10e391ee16aece4ecb4538e4414?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c6d2d10e391ee16aece4ecb4538e4414?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","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":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/bun-rewrite-in-rust-zff65rp1d","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"rust,ai-coding,claude-code,zig,bun","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Bun rewrite in rust"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/bun-rewrite-in-rust-zff65rp1d","comment":[{"@type":"Comment","text":"This article was hard to read.","datePublished":"2026-07-20T18:51:35.743Z","url":"https://daily.dev/posts/zff65RP1d#c-BMKzGPw6e","author":{"@type":"Person","name":"Kahlil Wallace","url":"https://daily.dev/khauma","image":"https://media.daily.dev/image/upload/s--QvppE9Ip--/f_auto/v1767378558/avatars/avatar_7eQFeSQRDx0muV3n92gxT?_a=BAMAK+ZW0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/bun-rewrite-in-rust-zff65rp1d#faq","mainEntity":[{"@type":"Question","name":"Did Bun switch from Zig to Rust?","acceptedAnswer":{"@type":"Answer","text":"Bun was reportedly rewritten entirely from Zig to Rust in July 2026, migrating roughly 535,000 lines of code in 11 days using 64 parallel Claude Code agents. The effort reportedly cost about $165,000 in Claude API usage, reached 1,300 lines per minute at peak, and passed Bun's full TypeScript test suite. Reasons cited include memory safety issues in Zig and a larger Rust contributor pool. Track fast-moving runtime changes like this Bun migration story on daily.dev before you plan an upgrade."}},{"@type":"Question","name":"Why did Bun move away from Zig?","acceptedAnswer":{"@type":"Answer","text":"Bun's creator cited memory management bugs such as use-after-free and double-free errors in Zig, along with Rust's compiler-enforced lifetime tracking and RAII-based cleanup as safety improvements. A larger Rust contributor ecosystem was also cited as easing bug fixes and community maintenance compared to Zig's smaller pool of developers. Developers weighing Zig against Rust for systems work can follow this debate on daily.dev."}},{"@type":"Question","name":"Was Bun acquired by Anthropic?","acceptedAnswer":{"@type":"Answer","text":"Bun was reportedly acquired by Anthropic on December 2, 2025, because Anthropic's Claude Code coding tool relies heavily on Bun's runtime, package manager, and bundler to compile and distribute standalone executables to millions of users. Keep up with Claude Code's underlying tooling changes on daily.dev as they affect your workflow."}}]}
```

