Odobren je prevod JavaScript platforme Bun na jezik Rust

Jarred Sumner, the creator and lead developer of the server-side JavaScript platform Bun, acknowledged the successful experiment of rewriting the project from Zig and Rust using the AI assistant Claude Code and decided to translate Bun to Rust. The rewritten version in Rust has already been accepted into the main repository of the project, while the Zig code is scheduled for removal. Additionally, the author of Bun announced the hiring of employees with over 5 years of experience in C/C++ and Rust development to support Bun.

Currently, a direct port from Zig to Rust has been implemented, which includes numerous blocks of unsafe code, uses the same architecture, the same data structures, and the previous external libraries. It is noted that the Rust port successfully passed the existing test suite on all platforms. Several memory leaks and test failures were also eliminated in the process.

After building the version in Rust, the executable file turned out to be 3-8 MB smaller than the one built in Zig. In performance tests, the Rust version was either faster or on par with the previous version. According to Jarred, the most important advantage of the Rust variant is the ability to catch and prevent errors related to memory management, which have taken up a lot of developers' time in recent years.

The reason for rewriting in Rust previously cited was the desire to eliminate issues in Bun caused by memory leaks, disagreements with the authors of Zig regarding the use of AI for code writing, and the unacceptable policy of Zig regarding compatibility-breaking changes for large projects.

Platforma JavaScript Bun se razvija kot visoko zmogljiva alternativa platformama Node.js in Deno. Projekt se razvija z mislijo na zagotavljanje združljivosti s strežnimi aplikacijami za Node.js in podpira večino API-jev Node.js. Vključuje niz orodij za razvoj in izvajanje aplikacij v JavaScript in TypeScript, ter runtime za izvajanje JavaScript aplikacij brez brskalnika, upravitelja paketov (združljivega z NPM), orodje za izvajanje testov, sistem za sestavljanje samostojnih paketov in vmesnik za vključitev obdelovalcev, napisanih v jeziku C. Po zmogljivosti Bun znatno prekaša Deno in Node.js (v preizkusih na osnovi ogrodja React platforma Bun prekaša Deno za 2-krat in skoraj 5-krat Node.js). Za izvajanje JavaScripta se uporablja JavaScript motor JavaScriptCore in komponente projekta WebKit z dodatnimi popravki.

Izvor: opennet.ru

Kupite zanesljivo gostovanje za spletne strani z zaščito pred DDoS, VPS VDS strežniki 🔥 Kupite zanesljivo gostovanje za spletne strani z zaščito pred DDoS, VPS VDS strežniki | ProHoster