Rewriting Bun in Rust
Bun, a 535k-line Zig JavaScript runtime, was mechanically ported to Rust over 11 days using about 50 continuously running Claude Code workflows.
Bun, a 535k-line Zig JavaScript runtime, was mechanically ported to Rust over 11 days using about 50 continuously running Claude Code workflows.
Bun's package manager installs dependencies roughly 7× faster than npm, 4× faster than pnpm and 17× faster than yarn because it treats installation as a systems programming problem: the bottleneck on modern NVMe hardware is system call and thread-coordination overhead, not I/O wait. strace benchmarks show bun making ~166k syscalls versus ~1M for npm and ~4M for yarn, with almost no futex contention, because its Zig code calls the kernel directly instead of going through Node's libuv thread pool.
Bun v1.2.1 fixes 32 bugs and adds S3 storage class support, X25519 key generation in crypto.generateKeyPair, Node's --zero-fill-buffers flag, indented inline snapshots in bun test, and a bunfig option to disable minification for HTML imports.
Bun v1.1.39 introduces bun.lock, a JSONC text lockfile enabled via `bun install --save-text-lockfile`, replacing the hard-to-review binary bun.lockb and planned as the default in Bun v1.2.
Bun v1.1.33 fixes 8 bugs, mostly in `bun install`. The default maximum of simultaneous network connections drops from 256 to 64 to avoid install slowdowns, `optional = false` in bunfig.toml now actually skips optional dependencies, and failed optional-dependency postinstall scripts are ignored and their half-installed directories removed.
Bun v1.1.17 fixes four bugs and makes two small macOS performance improvements.
Bun v1.1.5 replaces unsymbolicated crash output with a compact ~150-byte bun.report URL that encodes platform, subcommand, commit SHA, a 64-bit feature-usage bitfield, crash type and message, and ASLR-adjusted stack addresses as base64 VLQs, with no personal information.
Bun v0.6.13 adds Date mocking in bun test via setSystemTime, which affects Date.now(), new Date() and Intl.DateTimeFormat without mutating the Date object as Jest does.
Bun v0.1.9 starts using JavaScriptCore's DOMJIT API to JIT-optimize native functions, making `ptr()` in `bun:ffi` 6-10x faster and `TextEncoder.encodeInto` 1.5-5x faster.