news.volyx.in

Bun: Fast JavaScript runtime, transpiler, and NPM client written in Zig (bun.sh)

1431 points by firloop · 1529 days ago · 314 comments on HN

Article summary

Bun is a fast JavaScript runtime and toolkit that includes a package manager, test runner, and bundler. It is designed to be a replacement for Node.js and offers improved performance and efficiency. Bun's package manager is up to 30 times faster than npm and uses a binary format for lockfiles and manifests. The toolkit also includes a range of built-in APIs for tasks such as HTTP, WebSockets, and database interactions.

Main themes

  • JavaScript runtime performance
  • Package management efficiency
  • Binary formats and caching
  • Language tooling and development
  • npm and Yarn comparisons
  • Bun features and optimizations
  • JavaScript development complexity
  • Dependency management and bloat

What commenters say

  • The performance advantage of Bun is largely due to its optimized system calls and binary formats for lockfiles and manifests.
  • The use of JavaScript for building language tooling can be limiting due to the language's characteristics.
  • Yarn v2 and v3 offer improved performance and features such as Zero Install and Plug'n'Play architecture, but may not be fully backwards compatible.
  • The slowness of npm and other package managers may be due to their use of JSON parsing and other inefficiencies.
  • Bun's caching of manifest responses is not the main optimization, but rather the system calls used to copy/link files.
  • The binary format for lockfiles and manifests may not make a significant difference in execution time.
  • Some users experience slow performance with npm and other package managers, even with small projects and few dependencies.
  • The complexity of JavaScript development and the number of dependencies can contribute to slow performance and bloat.