Function#fork

Dean Landolt dean at deanlandolt.com
Mon Sep 24 07:57:11 PDT 2012


On Mon, Sep 24, 2012 at 10:44 AM, David Bruant <bruant.d at gmail.com> wrote:

>  Le 24/09/2012 16:39, Dean Landolt a écrit :
>
> s/shared state/shared *mutable* state/
>
> True, I took it as granted, since objects are by default (very) mutable in
> JavaScript.
>

Not necessarily, and they certainly don't have to be. To reiterate:
immutable doesn't mean they have no update operations, just that these
operations don't update-in-place. It's the difference between
Array.prototype.concat and Array.prototype.push. With vm support this could
be done cheaply. Code would be easier to reason about. There are some other
subtle wins like being able to keep aggregate calculations in the tree
branches (like how CouchDB stores its reduce calcs, but more generalizable,
see [1]). Oh, and you'd be able to pass these objects freely between worker
boundaries.

There's plenty of room in the language for persistent immutable collections.

[1] http://en.wikipedia.org/wiki/Finger_tree
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120924/02a27eb0/attachment.html>


More information about the es-discuss mailing list