Post

Threads in an ahead of time JS compiler is a brave weekend. SharedArrayBuffer needs COOP and COEP headers in the browser, so the demo host has to send both or Atomics never shows up.

Interesting! Would this open up a future where we could just load in JS (with a special import or <script> tag) that would then run in its own thread instead of the main one? Or would the script itself need to opt-in?

I think it is a long way off before this would become standardized. I think one of the major engines would have to implement it and back a real proposal. In the meantime js to wasm is becoming closer to a real alternative for some use cases.

Sure, but I was thinking more along the lines of how great it would be to move JS libraries off the main thread, without them having to support that explicitly. But maybe that wouldn’t be possible, not even with this implemented?