Re:Immutable Data Collections for Javascript
by Touche on Wednesday July 30, 2014 @12:58PM
(#8109404)
Isn't this library probably cloning?
[ Parent
| on HN ]
Re:Immutable Data Collections for Javascript
by rojoca on Wednesday July 30, 2014 @02:33PM
(#8110100)
If you watch the linked video above you will see how clever persistent data structures mean that nothing is ever cloned or copied.
Re:Immutable Data Collections for Javascript
by bsimpson on Wednesday July 30, 2014 @07:36PM
(#8111610)
Good to know. I never got into immutable collections because I presumed they would result in things being allocated all the time (and that that would be expensive).
Re:Immutable Data Collections for Javascript
by nawitus on Wednesday July 30, 2014 @01:13PM
(#8109535)
I'd guess this library clones on modification, but I was talking about cloning the object on every function call.
Re:Immutable Data Collections for Javascript
by room271 on Wednesday July 30, 2014 @04:06PM
(#8110615)
Persistent data structures allow for the appearance of cloning (you have a new thing) but are much more efficient behind the scenes (you don't actually copy everything). So if you find yourself doing a lot of defensive cloning, then Mori or this library would probably be a lot faster for you.
Re:Immutable Data Collections for Javascript
by nawitus on Thursday July 31, 2014 @03:11PM
(#8116295)
Absolutely! If anyone is reading this, I recommend Eric Lippert's 11 part series on immutability in C#. The concept apply everywhere, of course.
http://blogs.msdn.com/b/ericlippert/archive/2007/11/13/immut...