Bun Adds Shared-Memory Threads to JavaScriptCore
Bun open PR for shared-memory threads in JavaScriptCore

A recent open PR on GitHub proposes adding shared-memory threads to JavaScriptCore, a significant development for the JavaScript ecosystem. This feature would enable true parallelism in JavaScript, allowing developers to run functions on separate threads while sharing the same heap and objects. The implications of this change are substantial, as it could fundamentally alter how JavaScript applications are designed and developed. ## What happened The PR, submitted by Jarred-Sumner, introduces a new Thread function that allows running functions on separate threads, all within the same heap and with access to the same objects. This approach eliminates the need for structured cloning, message passing, or relying on SharedArrayBuffer as an escape hatch. The implementation has made significant progress, with parallel JavaScript execution through all four JIT tiers and the thread test suite now passing without a global lock. However, the PR is still in its experimental phase and requires further work, including thread-sanitizer cleanup, fuzzing, and benchmarking. ## Why it matters The addition of shared-memory threads to JavaScriptCore matters because it addresses a long-standing limitation of JavaScript: its single-threaded nature. By enabling true parallelism, developers can create more efficient and scalable applications. This feature could particularly benefit applications that rely heavily on computational tasks, such as scientific simulations, data processing, and machine learning. The change also aligns with the broader trend of increasing parallelism in software development, driven by the growing availability of multi-core processors.
- Enables true parallelism in JavaScript, improving performance and efficiency.
- Simplifies development by allowing shared access to objects and eliminating the need for complex messaging protocols.
- Could lead to significant advancements in applications that rely on computational tasks.
- Introduces complexity and potential risks associated with shared-memory concurrency, such as race conditions and memory leaks.
- May require significant changes to existing codebases and development practices.
- Could lead to increased memory usage and potential performance issues if not managed properly.
What are shared-memory threads in JavaScriptCore?+
How do shared-memory threads differ from workers in JavaScript?+
What are the potential benefits and risks of using shared-memory threads in JavaScriptCore?+
- engineering·2 min readClaude Code v2.1.181 Switches to Rust‑Based Bun, Boosting Startup Speed by 10%
Claude Code v2.1.181 now runs Bun compiled in Rust, delivering a 10% faster startup on Linux and previewing Bun v1.4.0 ahead of release.
- engineering·3 min readHow I Replaced a $120k Bowling Center Scoring System with $1.6k of ESP32 Hardware
A family rebuilt an abandoned bowling center's scoring and control system using ESP32 microcontrollers for under $2,000, cutting costs dramatically.
- engineering·3 min readWhat building 2,500 Jamcorder recorders taught me about hardware vs software
Selling 2,500 simple recorders revealed that hardware can be easier than software, reshaping indie makers' expectations.
The week’s highest-signal tech and AI stories, synthesized into a five-minute read. One email a week, no spam, unsubscribe anytime.