3 ms·
JavaScript's (and so Node's) limited concurrency primitives and unfettered mutability have, in my experience, resulted in its making a number of concurrency-rel
by michaelsbradley 13y ago
JavaScript's (and so Node's) limited concurrency primitives and unfettered mutability have, in my experience, resulted in its making a number of concurrency-related problems harder to deal with, not easier.
Mutability can be tamed with the help of libraries that provide immutable collections[1]. The best concurrency facility for JavaScript that I've found is core.async[2], but you can't really mimic it with vanilla JavaScript as the language doesn't provide macros. It might be interesting, though, to see if the core.async patterns could be implemented in terms of sweet.js[3] and with the help of esprima or acorn[4].
[1] mori, for example: http://swannodette.github.io/mori/ http://swannodette.github.io/mori/
[2] https://github.com/clojure/core.async https://github.com/clojure/core.async
[3] http://sweetjs.org/ http://sweetjs.org/
[4] http://esprima.org/ http://esprima.org/
[&] http://marijnhaverbeke.nl/acorn/ http://marijnhaverbeke.nl/acorn/