Introduced the release of the Bun 1.4 platform, designed for standalone execution of applications written in JavaScript and TypeScript, and aimed at using as a transparent replacement for the Node.js platform. Branch 1.4 is notable for the translation of the code base from the Zig language to the Rust language, carried out using Claude’s AI tools. The code continues to distributed under the MIT license.
The reason for rewriting in Rust is the desire to eliminate problems in Bun caused by memory leaks, as well as disagreements with the Zig authors in terms of using AI to write code and Zig’s policy of accepting changes into the language that violate compatibility, which is unacceptable for large projects. The main advantage of switching to Rust is the ability to catch and prevent errors when working with memory, the diagnosis of which has taken a lot of time from the Bun developers in recent years.
Judging by tests, the Rust version consumes 13-48% less memory, starts up twice as fast and loads the CPU up to 5 times less when idle. The size of the executable file in the Rust version was reduced by 17%. When running the Claude Code application using Bun 1.4, the CPU load was halved.
The composition includes 1517 additional compatibility tests and fixed more than 2900 problems. New libraries Bun.Image, Bun.WebView, Bun.markdown, Bun.cron() and Bun.Terminal have been added to the base package. The “bun run” and “bun test” commands implement a parallel launch mode (–parallel). Compatibility with Next.js 16 and vitest frameworks is ensured.
The Bun project supports most of the Node.js API. The platform includes a set of tools for creating and running applications in JavaScript and TypeScript, as well as a runtime for running JavaScript applications without a browser, a package manager (NPM compatible), tools for running tests, a system for building self-contained packages, and a layer for embedding handlers written in the C language. In terms of performance, Bun is noticeably ahead of Deno and Node.js (in tests based on the React framework, the Bun platform is 2 times faster than Deno and almost 5 times faster than Node.js). To execute JavaScript, the JavaScript engine JavaScriptCore and project components WebKit with additional patches are used.