News for hackers. Stuff that matters.
Re:What's new in purely functional data structures since Oka... by dikaiosune on Monday February 08, 2016 @09:41AM (#11058294)
Can those pointer types break cycles?
Re:What's new in purely functional data structures since Oka... by pjmlp on Monday February 08, 2016 @11:11AM (#11058875)
No, unless you make use of weak_ptr.

The problem with RC based solutions is that to beat the top of top GC implementations, they need compiler support and so many tricks that in the end one gets RC + mini-GC anyway.

For example, Cedar at Xerox PARC used RC with local GC for cycle collection, instead of trying to use lots of tricks for RC performance fine tuning.

Re:What's new in purely functional data structures since Oka... by strmpnk on Monday February 08, 2016 @11:16AM (#11058919)
That's an interesting point. One of the nice things about immutable structures is that old things can never point at new things. (Some might exploit laziness to allow some sort of loop but I'd count that thunk as a mutable structure, even if it's referentially transparent like in Haskell.)

Some functional languages leverage this sort of restriction to their advantage. It can simplify garbage collection and serialization protocols don't need to track visited nodes for example. It's certainly nice to be able to step out of this mode from time to time and many functional languages provide controlled effects of sorts. I think an interesting area to study would be the balance between minimal effects and otherwise immutable structures. I wouldn't however, use this to sacrifice persistence, which it seems many implementations do.