My Long Term Vision for the D programming language

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Nov 23 17:55:30 UTC 2021


On Mon, Nov 22, 2021 at 02:27:00PM +0000, IGotD- via Digitalmars-d wrote:
> On Monday, 22 November 2021 at 12:33:46 UTC, Imperatorn wrote:
> > 
> > ORC seems like a pretty nice solution
> 
> Yes, since the cycle detection is automatic there is no necessity to
> badge references as 'weak' in order to avoid cyclic references. So it
> is a compromise between reference counting and tracing GC. Nice really
> since automatic memory management should really be automatic.

I skimmed through the paper yesterday.  Very interesting indeed!  The
nicest thing about it is that it's completely transparent: application
code doesn't have to know that ORC is being used (rather than, e.g.,
tracing GC).  As long as the refcount is updated correctly (under the
hood by the language), the rest just takes care of itself.  As far as
the user is concerned, it might as well be a tracing GC instead.  This
is good news, because it means that if we hypothetically implement such
a scheme in D, you could literally just flip a compiler switch to switch
between tracing GC and ORC, and pretty much the code would Just
Work(tm).

(Unfortunately, a runtime switch isn't possible because this is still a
ref-counting system, so pointer updates will have to be done differently
when using ORC.)


T

-- 
GEEK = Gatherer of Extremely Enlightening Knowledge


More information about the Digitalmars-d mailing list