D programming language popularity

Paulo Pinto pjmlp at progtools.org
Sun Nov 8 19:12:06 UTC 2020


On Sunday, 8 November 2020 at 17:38:01 UTC, random wrote:
> On Sunday, 8 November 2020 at 13:39:17 UTC, Ola Fosheim Grøstad 
> wrote:
>> On Sunday, 8 November 2020 at 13:28:02 UTC, random wrote:
>>> [...]
>>
>> 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 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?

Yes, in systems languages like Modula-3, Active Oberon, or if you 
prefer something more modern, .NET Native, Swift or Go, the 
pointers are safe by default and you have an explicit unsafe 
pointer for "do any kind of tricks pointer".


More information about the Digitalmars-d mailing list