D programming language popularity

random frederick.muller at existiert.net
Sun Nov 8 17:38:01 UTC 2020

On Sunday, 8 November 2020 at 13:39:17 UTC, Ola Fosheim Grøstad 
> On Sunday, 8 November 2020 at 13:28:02 UTC, random wrote:
>> If I understand it right you also can't have a GC with heap 
>> compaction in D, because this would invalidate pointers. Most 
>> high performance GCs use heap compaction...
> It is possible, but expensive..

How would you do this? Track all pointers (type system knows 
them) and if you move the object update all pointers to that 
object. What is with something evil like C++ iterator::end(), 
which is often a pointer one past the last valid element in the 
buffer? I think you would have to track for all pointers to which 
GC allocated object they belong...

>> The language relies on GC (you can't use all features without 
>> it), but at the same time it is designed in a way you can't 
>> have a competitive GC (compared to JVM/CLR).
> The problem is that raw C pointers can be owning pointers. So 
> it would be a breaking change.

This is not completely clear to me. Do you mean (like you said 
previously) that an other pointer type is needed so GC can 
differentiate between them? Is there something else I'm missing 
about ownership?

More information about the Digitalmars-d mailing list