Bun 1.4 lands: Rust rewrite and zero external dependencies mark major milestone for devs

Bun 1.4 lands: Rust rewrite and zero external dependencies mark major milestone for devs

Bun 1.4 has arrived as a landmark release for the JavaScript runtime, marking its transition to being fully written in Rust, a shift that comes after months of development and early adoption by tools like Claude Code and Prisma. This architectural change represents more than just a language migration; it signals Bun's maturation as a production-ready alternative to Node.js and Deno. The rewrite is paired with significant performance gains, including reduced memory footprint, lower CPU consumption, and faster startup times, achieved largely by consolidating on the mimalloc allocator and introducing features like partial page clearing and a scavenger thread for memory reclamation during idle periods.

Beyond infrastructure changes, the release dramatically expands Bun's standard library with 15 additional built-in dependencies, bringing external package requirements down to zero. Previously external utilities like sharp, puppeteer, marked, tar, and node-cron are now bundled natively, alongside existing capabilities such as Bun.Image for image processing, Bun.WebView for headless browsing, Bun.markdown for rendering, and Bun.cron for scheduled jobs. This move effectively challenges npm's dependency-heavy ecosystem, positioning Bun as a more self-contained execution environment that prioritizes developer experience through out-of-the-box functionality.

The release also tightens compatibility with Node.js ecosystems by implementing previously missing APIs including worker_threads, node:cluster for socket sharing between workers, node:repl, and node:domain. Package management has seen substantial refinement as well: bun update now handles transitive packages correctly, workspace filtering works as expected, and catalog overrides in bunfig.toml take precedence over .npmrc. Bundler improvements include 14× faster code splitting on large graphs and smarter browser field remapping that reduces bundle sizes significantly, with jszip cited as a case study dropping from 459 KB to 149 KB.

While Bun continues to chase parity with established runtimes, version 1.4 demonstrates a strategic pivot toward depth over breadth: fewer breaking changes, more stability improvements, and a foundation built for longevity. The Rust rewrite, combined with the elimination of external dependencies, suggests the team is betting on consolidation and performance optimization rather than feature proliferation. For teams evaluating Bun for production, this release removes several friction points that may have held back earlier adopters, though enterprise readiness ultimately depends on real-world deployment validation beyond the benchmarks and promises outlined in the release notes.

by Paul

Add as a preferred source on Google
Bun iconBun
  21
  • ...

Bun is an incredibly fast JavaScript runtime that integrates a bundler, transpiler, and package manager into a single tool. Rated 5, it offers robust support for TypeScript and features a command line interface designed for speed and efficiency. Bun is a comprehensive solution for developers seeking to streamline their workflow with a focus on performance.

Comments

Alexandre ZANNI
0

I didn't know Bun was acquired by Anthropic. The rewrite it from Zig to Rust just to show Claude can rewrite a massive project (https://bun.com/blog/bun-in-rust) do you think? Or is it really for memory safety?

1 reply
Alex Ruiz

Rust is generally a memory-safe language, however one can override safeties using the 'unsafe' keyword in Rust. The initial slop merge did this over 13,000 times, which is a lot for a project of its size. The uv project in Rust, which has half the lines of code as Bun, only has several dozen 'unsafe' flags by comparison. I don't know if this has been fixed in the 1.4 release or not, but it's not a great starting position for the rewritten project if one is to suggest the goal was better memory safety.

There are probably several other reasons why this rewrite was done though:

  1. Bun was originally written in Zig, and Zig has a pretty aggressive anti-LLM/anti-slopcoding stance, which obviously conflicts with being a property owned by Anthropic.
  2. The Rust community includes more people and resources than Zig, so it would be easier to hire people to work on this project if it was using Rust rather than Zig.
Creative_joe
1

https://youtu.be/i38DgEuaJwM

They left the comment section open.

1 reply
Alex Ruiz

That was a big mistake on their part.

Gu