The new JavaScript runtime Bun challenges Node, Deno & Co

The new JavaScript runtime Bun challenges Node, Deno & Co

As an all-in-one runtime for bundling, transpiling, installing and running JavaScript and TypeScript projects, the new JS runtime Bun takes on established competitors such as Node and Deno. The open source project initiated by Jarred Sumner under the MIT license has only just reached version 0.1.1 and is still classified as “experimental software” according to the GitHub repo. Written in the Zig programming language and based on the WebKit JavaScript core engine, Bun is said to score particularly well with its high speed.

In his announcement on Twitter, former Stripe frontend engineer Sumner advertises some self-run benchmarks intended to document Bun’s performance in comparison to Node and Deno. When rendering React on the server side, Bund processes about three times more http requests per second than Node, and almost four times more than Deno. Bun achieves a similar lead with queries in larger database tables.

According to Sumner, Bun is written from the ground up in the community-driven Zig programming language and benefits from integration with the WebKit JavaScript core engine, which runs faster than popular alternatives such as V8. Above all, Bun wants to convince developers with a complete package – including a JSX/TypeScript transpiler, an npm client, a bundler and clients for SQLite, HTTP and WebSocket.

As usual with Deno, Bun also automatically transpiles TypeScript – as well as JS and JavaScript XML syntax. Bun also supports resolving Node.js modules, with both CommonJS and EcmaScript (ESM) modules. This should allow most of the npm packages to be used. If necessary, native code can also be exported via bun:ffi (foreign function interface) call.

Relying on Zig for the development of Bun, a language currently in version 0.9.1 also still in an early stage, is justified by Sumner with the advantages of its manual low-level memory control and the lack of a “hidden control flow”. This would make it easier for developers to write fast software. On the other hand, they have to do without memory security like with Rust.

More information about Bun can be found on the project website and in the repo on GitHub. Bun is currently available for Linux, macOS and Windows Subsystem for Linux.

Lockdown mode comment: Good thing Apple, move on!  But... Previous post Lockdown mode comment: Good thing Apple, move on! But…
Interview with Ladybird developers: What works correctly with the browser alternative Next post Interview with Ladybird developers: What works correctly with the browser alternative