TLDR · PROGRAMMING, DESIGN & DATA SCIENCE
REWRITING BUN IN RUST
Summary from the TLDR newsletter
Bun was facing a large number of bugs that were use-after-free, double-free, or 'forgot to free' in an error path. In safe Rust, these are compiler errors and RAII-like automatic cleanup with Drop, so it made sense to rewrite Bun in Rust. However, such a task would take a small team of engineers a full year to complete. As an experiment, one of Bun's developers tried using Anthropic's new models to rewrite Bun in Rust. This resulted in a runtime that was faster, smaller, and used less memory. This article discusses the lessons and tricks learned during the agentic development process.