My Long Term Vision for the D programming language

Araq rumpf_a at web.de
Tue Nov 23 19:22:11 UTC 2021


On Tuesday, 23 November 2021 at 17:55:30 UTC, H. S. Teoh wrote:
> 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

As long as D doesn't distinguish GC'ed pointers from non-GC'ed 
pointers and allows for unprincipled unions I fail to see how 
it's "good news". Multi-threading is also a problem, in Nim we 
can track global variables and pass "isolated" subgraphs between 
threads so that the RC ops do not have to be atomic. Copying ORC 
over to D is quite some work and in the end you might have a D 
that is just a Nim with braces. Well ... you would still have 
plenty of D specific quirks left I guess.


More information about the Digitalmars-d mailing list