Proof of concept for v2 - NO duplication, NO `static if` hell, NO difficulty with interoperability

Andrei Alexandrescu SeeWebsiteForEmail at erdani.com
Fri Nov 5 14:08:58 UTC 2021


On 2021-11-05 9:45, deadalnix wrote:
> On Friday, 5 November 2021 at 09:43:21 UTC, Dukc wrote:
>> On Friday, 5 November 2021 at 03:12:39 UTC, deadalnix wrote:
>>> On Sunday, 31 October 2021 at 01:59:38 UTC, Andrei Alexandrescu wrote:
>>>> https://github.com/dlang/phobos/pull/8309
>>>>
>>>> Destroy!
>>>
>>> I'm highly skeptical of making phobos 2 at this time. Maybe I'm 
>>> wrong, but we discussed it not so long ago, and I tried to work on 
>>> collections for it.
>>>
>>> Problem is: it is not possible, as far as I can tell, to write a high 
>>> quality collection library in D right now.
>>
>> That is an orthogonal problem. If we agreed to merge some collections 
>> library to Phobos, it could be done to Phobos 1 just as well. We don't 
>> need Phobos 2 for that.
>>
> 
> No it is not.
> 
> The reason for which phobos v1 does not have a good set of collection 
> have not changed, and therefore phobos v2 will not have a good set of 
> collections.
> 
> Range have the exact same problem.

Versioning and safe pure nogc reference counting (which is the true 
problem with implementing containers in D) are largely orthogonal. Or I 
should say just distinct, as "orthogonal" is unnecessarily precise.

We never got reference counting to work in safe pure nogc code. And we 
don't know how. If we did, we could write a slice-like type that does 
everything a slice does PLUS manages its own memory. This is the real 
problem with containers.


More information about the Digitalmars-d mailing list