3 ms·
This does look interesting, and from skimming it this seems to be about introducing the same sort of atomic primitives as found in clojure, ie. Atoms. And as fa
by josteink 11y ago
This does look interesting, and from skimming it this seems to be about introducing the same sort of atomic primitives as found in clojure, ie. Atoms. And as far as I know they were introduced to address the problem of shared, mutable state in a concurrent environment.
If Javascript doesn't have "real" threads, just unordered, asynchronous execution, what need do we have for atoms? You won't be having concurrent access to the shared, mutable state anyway.
Am I missing something?
- aardvark179 11y agoSharedTypedArrays, though whether this should be specified at the JS or WaASM level I'm not sure. What it lacks at this point is a defined memory model but they do seem to note they may want to add fences & so forth.
- chrisseaton 11y ago> Though not a part of this specification, we intend for the role of "threads" to be played by Web Workers in web browser environments.
- TeMPOraL 11y agoWhich reminds me - and sorry for going slightly off-topic - why on Earth does the JS world invent so many new names for things that already have perfectly good ones? For instance, why "Web Workers" instead of "threads"?
- chrisseaton 11y agoBecause with threads you expect shared memory. Web workers currently communicate only by message passing, more like a basic UNIX process. But they're unlike a UNIX process in other ways. If they used an existing name someone else would be on here complaining about that.