Bun v1.3.9
Bun v1.3.9 drops with a fresh batch of performance upgrades and developer-centric features. This release introduces built-in parallel/sequential script running, substantial JavaScriptCore optimizations for blazing speed, and crucial bug fixes, solidifying Bun's position as a fast, all-in-one JavaScript toolkit that keeps the HN crowd buzzing about execution models and terminology.
The Lowdown
Bun has rolled out version 1.3.9, packed with new capabilities and significant performance enhancements across its ecosystem. This update reinforces Bun's dedication to speed, compatibility, and a streamlined developer experience.
- Enhanced Script Runner: New
bun run --parallelandbun run --sequentialcommands allow concurrent or ordered execution of package.json scripts, supporting filtering and workspaces. Output is prefixed for clarity. - HTTP/2 Improvements: Correct handling of
net.ServertoHttp2SecureServerconnection upgrades, benefiting libraries and custom HTTP/2 proxy servers. - Testing Modernization:
mock()andspyOn()now supportSymbol.disposefor automatic cleanup, integrating with theusingkeyword for cleaner test code. - Network Robustness: The
NO_PROXYenvironment variable is now respected even when explicit proxy options are provided tofetch()orWebSocket(), resolving previous bypass issues. - Profiling Tools: A new
--cpu-prof-intervalflag is available to configure the CPU profiler's sampling rate, mirroring Node.js functionality. - Build System Flexibility: ESM bytecode is now supported with
--compile, offering more options for bundling. - Hardware Compatibility: Fixed
SIGILLcrashes on older ARMv8.0 aarch64 CPUs (e.g., Raspberry Pi 4) by correctly targeting ARMv8.0 on Linux. - Internal Optimizations (JavaScriptCore):
- RegExp: SIMD-accelerated prefix search and JIT compilation for fixed-count parentheses bring massive speedups.
- Built-in Methods:
String#startsWith,Set#size,Map#size,String#trimall see significant performance gains through DFG/FTL JIT intrinsics and optimized implementations. Object.definePropertynow recognized as an intrinsic, laying groundwork for future optimizations.String.prototype.replacenow returns ropes for string arguments, aligning with V8's memory efficiency.
- Bug Fixes: A wide array of fixes address Node.js compatibility (e.g.,
node:fson Windows), Bun API behavior (Bun.stringWidth), Web API issues (WebSocket client, HTTP server chunked encoding security), and TypeScript type definitions.
Overall, Bun v1.3.9 delivers a robust set of features and optimizations that continue to position it as a powerful and increasingly mature JavaScript runtime.
The Gossip
Scripting System Scrutiny
The new `bun run --parallel`/`--sequential` features sparked a lively debate. While some appreciated the simplicity and cross-platform utility as an alternative to writing bash scripts, a significant portion of commenters argued for more sophisticated build systems. They emphasized the need for dependency awareness (Directed Acyclic Graphs, or DAGs), content-addressable caching, and incremental builds, similar to tools like Google's Wireit or Bazel, especially for complex monorepos. Critics suggested that simple parallel/sequential execution lacks the intelligence required for truly efficient build orchestration.
Lexical Labyrinth: Parallel vs. Series
A tangent emerged discussing the optimal terminology for concurrent versus sequential execution in software. Commenters compared the terms to electrical engineering's "parallel and series," programming's "parallel and sequential," "concurrent," or "synchronous," and even legal definitions like "concurrent and consecutive." While "parallel and series" is understood due to its electrical context, the general consensus leaned towards "parallel and sequential" as being more precise and common in the software development discourse.
Performance Prowess & Progress
Many commenters lauded Bun's relentless pursuit of performance, particularly highlighting the extensive JavaScriptCore upgrades that promise significant speedups for regular expressions and core JavaScript methods. The continuous stream of bug fixes, improving Node.js compatibility, Web API adherence, and addressing critical issues like ARM64 crashes, was also well-received, reinforcing the perception of Bun as a rapidly maturing and highly performant runtime.