News for hackers. Stuff that matters.
Re:Go GC: Solving the Latency Problem in Go 1.5 by kasey_junk on Wednesday July 08, 2015 @10:04PM (#9855807)
> The only true benefit I can think of is reducing heap fragmentation

Unless something has changed recently in the literature, concurrent data structures, especially lock free ones are super difficult to get right without garbage collection. Further, lock free structures are one of the most straight forward paths to large non-contended concurrent in memory data sets becoming the norm rather than the exception.

I'm am by no means an expert on this topic so its entirely possible the state of the art has changed on this, but that is the obvious case I thought of when asking the question about missing something.

Re:Go GC: Solving the Latency Problem in Go 1.5 by pcwalton on Wednesday July 08, 2015 @11:05PM (#9855964)
They are easier with GC, yes. But hazard pointers work reasonably well as a substitute.

(Note that you need generics for lock-free data structures to be ergonomic.)

Re:Go GC: Solving the Latency Problem in Go 1.5 by pron on Thursday July 09, 2015 @03:17AM (#9856570)
... and I'll ask you the same question I always do: in that case, adding predictable, low latency arenas to GC languages is much easier than using hazard pointers (which are really a form of GC) to non-GC languages. Why should RC ever be the default?
Re:Go GC: Solving the Latency Problem in Go 1.5 by pcwalton on Thursday July 09, 2015 @12:52PM (#9859101)
> in that case, adding predictable, low latency arenas to GC languages is much easier than using hazard pointers (which are really a form of GC) to non-GC languages.

I disagree with that. I haven't seen "opt-out GC" work that well in practice. People use memory pools in GC'd environments to work around slow GCs, sure, but they're limited and have poor safety/ergonomics, as nobody wants to have to explicitly free data. They also don't really provide one of the greatest advantages of manual memory management, which is the ability to use stack allocation aggressively. (By "aggressively" I mean "in ways that an intraprocedural analysis with no knowledge of data lifetimes—i.e. an escape analysis—could not prove safe".)

Hazard pointers are a small feature, localized to exactly where you need them (concurrent data structures). Those who need concurrent data structures have to pay for the feature; those who don't don't have to. A pervasive GC, however, imposes its costs and benefits on the entire language ecosystem.

Re:Go GC: Solving the Latency Problem in Go 1.5 by pron on Thursday July 09, 2015 @02:17PM (#9859715)
> I haven't seen "opt-out GC" work that well in practice.

RTSJ (realtime Java). I've personally used it in a missile-defense system and it works perfectly, with hard realtime guarantees.

As I've said before, in-memory data comes in four flavors: stack, arena, permanent and arbitrary. It's very easy to have all four in a GC language, as RTSJ does very effectively.

> A pervasive GC, however, imposes its costs and benefits on the entire language ecosystem.

I would say the same about RC. RC and GC are both really good for a specific environment (constrained and unconstrained RAM respectively) and pretty bad for the other. Adding arenas and permanent areas for GC environments is just as easy/natural as for RC/manual environments. And, again, you get RC + arenas which are great for constrained environments and pretty bad for unconstrained, and GC + arenas which are great for unconstrained and pretty bad for constrained.