domenic / proposal-blocks

Former home of a proposal for a new syntactic construct for serializable blocks of JavaScript code
215 stars 5 forks source link

Support for SharedArrayBuffers and Atomic operations? #20

Open rwaldron opened 6 years ago

rwaldron commented 6 years ago

A severe pain point of using SharedArrayBuffers & Atomics is that they rely on the host runtime to provide a Worker or Worker-like thing to be useful. Is the intention of this feature to support shared memory via SharedArrayBuffers and Atomic operations on them?

domenic commented 6 years ago

Hmm, so this feature is mostly meant to be syntactic. The code you use inside the blöck could definitely use these things. But the intent isn't to propose some standard version of Worker. The examples in the README all use a worker() tag function, but you could use any tag (just like with tagged template literals). An implementation of worker(), shown inside a <details> element, itself builds on Worker.

I'm not sure if this quite answers the question...? Let me know!