• Category: Languages
  • Status: developing
  • Sources: oven-sh/WebKit PR #249, discussion
  • Summary: Bun author Jarred Sumner opened a pull request adding shared-memory threads to JavaScriptCore, where new Thread(fn) runs a function on another thread in the same heap with the same objects, rather than the worker model of separate heaps plus postMessage, structured clone, and SharedArrayBuffer. The design follows the Java, Go, and C# model: threads share the heap, races on application data are the program's problem, and the VM guarantees memory safety for engine internals (no torn JSValues or type confusion). The PR is labeled experimental and not yet working.
  • Comments: HN discussion (216 comments) weighs the appeal of sharing an object graph across threads for parsers, bundlers, and shared-cache servers against the risk of data races in code that has assumed single-threaded semantics, and questions how much of the existing JS ecosystem can rely on the new model.
  • Why it matters: Native shared-heap threading would remove the serialization tax that pushes JavaScript parallelism toward typed-array rewrites, but it is an early experiment, not a shipped feature.

Send feedback on this story