Bun.js is a flagship user of new Zig language, that is "human friendly".
Rust is much bigger and more complicated language, and while human developers who know it like it,
it is not easy. But now with AI Agents being able to code,
and Bun as part of Anthropic having likely unlimited access to AI,
a full translation from Zig to Rust apparently worked well enough, and quickly!
If nothing else this is an indication of what can and may be done with many other projects.
Not to mention Microsoft's even more controversial intent to port Windows apps to Rust from C++.
Rewrite Bun in Rust by Jarred-Sumner · Pull Request #30412 · oven-sh/bun @GitHub
It passes Bun's pre-existing test suite on all platforms (and fixes several memory leaks and flaky tests), the binary size shrinks by 3 MB - 8 MB, the benchmarks are between neutral and faster - and most importantly, we now have compiler-assisted tools for catching & preventing memory bugs, which have costed the team an enormous amount of development & debugging time over the years.
The codebase is otherwise largely the same. The same architecture, the same data structures. Bun still uses few 3rd party libraries. No async rust.
Bun Rewrites 1M Lines of Zig to Rust in 6 Days
Bun’s Bold Gamble: Porting a Million Lines from Zig to Rust with AI | by Sahil | May, 2026 | Medium
related

No comments:
Post a Comment