What's the go with the GC these days?

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Jan 7 19:38:01 UTC 2019


On Mon, Jan 07, 2019 at 07:18:02PM +0000, Russel Winder via Digitalmars-d wrote:
> On Sun, 2019-01-06 at 01:22 -0800, Walter Bright via Digitalmars-d wrote:
> > On 1/5/2019 11:48 PM, Manu wrote:
> > > Hmnm, that's pretty disappointing... as a C++ user who has been
> > > doing C++ ref counting for years, I would say that, while maybe it
> > > is *kinda* successful, it's not at all satisfying, and it's one
> > > major reason I've been pushing it in D for the last 8-9 years.
> > > Ref counting in C++ is a sloppy hack. I really just want the
> > > compiler to emit opInc and opDec appropriately on either sides of
> > > a reference assignment, and let me take it from there.  Also, with
> > > escape analysis, we can elide such calls very effectively, and we
> > > can't do that using the C++ strategy.
> > > 
> > > I think it's disappointing to embrace C++'s hacky 'solution', we
> > > could do better.
> > 
> > So far, we've failed at every attempt at it.
> 
> This is not an excuse to stop trying!
[...]

I think you may have misunderstood.  Read the "study" mailing lists that
Walter referred to.  You'll see some concrete examples of tricky
situations that may not be immediately obvious from a naive conception
of ARC.  It's not that we've stopped trying, but that we've run out of
good ideas and nobody has stepped up offering better ones.

After reading through said mailing lists, I think I better understand
now why Walter is pushing for dip25 and dip1000.  They tackle essential
issues related to proper escape analysis, which is a requirement for RC
counter bump elisions that won't cause UB or other nasty problems.  In
themselves they won't give you RC just yet, but they pave the way and
lay some of the essential foundations that an RC implementation will
require.


T

-- 
Never step over a puddle, always step around it. Chances are that whatever made it is still dripping.


More information about the Digitalmars-d mailing list