Bun is adding real shared-memory threads to JavaScript, and the PR description was written by Claude

For 30 years JavaScript has been single-threaded by design. Bun's open pull request gives it actual OS threads sharing one heap — and the man who first proved this was possible in 2017 showed up in the thread to say he's impressed an LLM pulled it off.

In brief

`new Thread(fn)` runs a closure on another OS thread inside the same heap, no postMessage, no structured clone, no SharedArrayBuffer. It implements a 2017 design that, until now, nobody had shipped.

Buried in the writeup: the garbage collector still stops the world. A VM-internals reader flagged it as the line that will wreck tail latency. Bun's creator, meanwhile, confirmed the whole PR description is Claude-generated.

What the PR actually changes about JavaScript

Pull request #249 against Bun's fork of JavaScriptCore adds something the language has never had: true shared-memory threading. You write new Thread(fn, …) and the closure runs on a separate OS thread inside the same heap — objects are shared directly, with no postMessage, no structured clone, no SharedArrayBuffer escape hatch.

GitHub pull request card for Bun's shared-memory threads PR
GitHub pull request card for Bun's shared-memory threads PR

Under the hood it implements Filip Pizlo's 2017 essay Concurrent JavaScript: It Can Work! — TID-tagged flat butterflies, per-object cell locks, segmented butterflies on first shared write. The claimed serial regression is 0.45% worst-case against a 1% gate; on a 64-core box the implementation reportedly tracks roughly 0.89× of Java's threading throughput at 16 threads.

The catch is one word: synchronous

The headline numbers look free until you read the middle of the post. A reader who works on virtual machines went looking for exactly that:

"I know a thing or two about VMs… 'No performance hit in the single threaded case? No way'. I was right. Buried in the middle of the post is this tidbit… A stop-the-world garbage collector will kill tail latency in many use-cases" — a commenter who works on VM internals

That is the load-bearing caveat. v1 collects synchronously and stops every thread to do it; concurrent marking is deferred. For a request-serving workload, a stop-the-world pause is precisely the thing you cannot afford.

The man whose design this is showed up

The 2017 paper that this PR turns into code was written by Filip Pizlo, then the JavaScriptCore lead. He read it:

"It's a very complex thing, but not impossible. I'm very impressed that any LLM can do this" — Filip Pizlo, author of the original concurrent-JavaScript design

That detail is not incidental. Bun's creator, Jarred Sumner, confirmed in the thread that the prose was machine-written — "And yes, the PR description is entirely Claude" — and described the stakes of merging it:

"I'm the author of this PR… This PR is scarier to merge than Bun's Rust rewrite PR… If we had both threads and structs, it's likely the TypeScript compiler would never have needed to be rewritten in Go." — Jarred Sumner, creator of Bun

Not everyone is cheering the unilateral language extension. A standards-side voice was blunt about where this lands with the people who actually own the spec:

"I ran your proposed changes by TC39 and their initial reaction was simply 'no'. Is Bun the new IE6, then?" — a commenter who took the proposal to TC39

Why "Bun the new IE6" is the sharpest line in the thread

The IE6 jab is the real argument. A runtime can ship a heap-sharing Thread primitive tomorrow; the standards body cannot un-ship it. If enough code comes to depend on Bun-only threading, the behavior becomes a de-facto standard that every other engine has to either copy or break. That is the exact dynamic that made IE6 a decade-long problem. The engineering here is genuinely hard and, by the original designer's own read, genuinely good — but the thing the thread is nervous about is not the GC pause. It is one runtime deciding the future of a shared language by merging it.

Get breakdowns like this every day

The top Hacker News stories, unpacked — by email, Telegram, or RSS.

Next story · 8 of 30 Read more
🔥Hot Discussion

The UK age-gated social media, kids switched to VPNs, so now the government is eyeing VPNs

A minister told MPs she will return in July with a statement on VPNs because she is 'not happy with the evidence'. The thread's verdict on the loop was immediate: ban a thing, people route around it, ban the route around it, repeat.

★ 290 · 💬 323 · birminghammail.co.uk · 3 min