
"A pull request with a Rust version of Anthropic's Bun, a JavaScript toolkit and runtime originally written in Zig, has been merged to the main Bun repository. Thos comes just days after its author, Jared Sumner, said "there's a very high chance all this code gets thrown out.""
"Sumner posted on X (formerly Twitter) five days ago that "99.8 percent of bun's pre-existing test suite passes on Linux x64f glibc in the rust rewrite," a clue that what was initially described as an experiment was likely to make it to production. Three days later, the Bun team released version 1.3.14, with Sumner stating that if the Rust rewrite was merged, "this would be the last version in Zig.""
""Most importantly, we now have compiler-assisted tools for catching and preventing memory bugs, which have cost the team an enormous amount of development and debugging time over the years," he said in a comment. Performance is either neutral or faster, he said, though the codebase is "the same architecture, the same data structures." No async Rust is used."
""Rust won't catch all of these - leaks from holding references too long and anything that re-enters across the JS boundary are still on us. But a large percentage of that list is use-after-free, double-free, and forgot-to-free-on-error-path, and those become compile errors or automatic cleanup.""
A Rust version of Bun, originally written in Zig, was merged into the main Bun repository. The change followed a period of testing where most of the existing test suite passed on Linux x64 with glibc. Bun version 1.3.14 was released with the expectation that the Rust rewrite would end the Zig codebase. The merge added more than one million lines of code, passed tests across platforms, fixed some memory leaks, and reduced binary size by 3 to 8 MB. Compiler-assisted tools were added to catch and prevent memory bugs, with performance neutral or faster. No async Rust was used, and the architecture and data structures remained the same. Rust reduces many memory issues but does not eliminate leaks from long-held references or cross-language boundary re-entrancy.
Read at theregister
Unable to calculate read time
Collection
[
|
...
]