Nim's ORC - Vorsprung durch Algorithmen

Petar Petar
Mon Feb 1 14:08:06 UTC 2021

On Monday, 1 February 2021 at 13:41:24 UTC, zoujiaqing wrote:
> On Monday, 1 February 2021 at 10:33:43 UTC, IGotD- wrote:
>> On Monday, 1 February 2021 at 09:46:48 UTC, zoujiaqing wrote:
>> Yes, what are we supposed to discusss?
> Okay! D language should also be used for reference in memory 
> management! isn't it? What do officials think? What does the 
> community think?

I think it's a great option to have and we should work on a 
similar feature for D.
It has been discussed many times in past in this newsgroup, but 
as far as I know no one has actually started working on it yet. 
Perhaps it can be a #saoc or #gsoc project?

On the library side, I think that exposing the GC building blocks 
(like std.experimental.allocator) would help.

On the type system side, #dip1000 and something like #dip2021 
certainly help, but are only parts of the bigger story. IIRC Nim 
has a strict separation between "managed" and raw pointers, while 
in D they're the same type (class references also have unclear 
ownership semantics).

One of the optimizations mentioned in this article:

> The Nim compiler analyses the involved types and only if it is 
> potentially cyclic, code is produced that calls into the cycle 
> collector. This type analysis can be helped out by annotating a 
> type as acyclic.

This can easily done in D, both by meta-programming and inside 
the compiler. Perhaps it can be added on top of our existing 
support for precise GCs 

More information about the Digitalmars-d mailing list