Thoughts from newcommer

Jerry via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 17 08:24:26 PDT 2017


On Monday, 17 April 2017 at 15:10:59 UTC, Jack Stouffer wrote:
> On Monday, 17 April 2017 at 02:56:00 UTC, Jerry wrote:
>> Okay, only one container, and happens to be most simple basic 
>> one. The others aren't nogc and some of them are even classes. 
>> Not only that, Array wasn't @nogc until about a month ago.
>>
>> No idea what you mean about goal posts. Do you mean it's not 
>> an issue worth discussing? You made a false claim, and you 
>> still you are still persisting in it as if having a single 
>> container be @nogc solves the entire issue.
>
> The first question was whether D had RAII or not. When it was 
> shown that D does have RAII, then the goal posts were moved 
> back to D needing RAII containers that cleaned up their 
> elements on scope exit. When it was shown that D absolutely has 
> RAII containers (that clean up all resources including GC ones 
> on scope exit) then the goal posts were moved back yet again to 
> the containers needed to be @nogc containers. This is despite 
> the fact that @nogc has nothing to do with RAII and is just 
> something people want for convenience.

It has everything to do with @nogc, if it isn't @nogc then it is 
using the garbage collector and even if it is using Destroy() it 
is still invoking the GC and something is still going to have to 
be freed by the GC, even if that class is empty. You can't say it 
is RAII if it is using the GC, that's just nonsense. So it is not 
just for convenience.

Not to mention for some reason Array's internal implementation is 
ref counted. If you want ref counted arrays you should do 
RefCounted!(Array!T). Std.containers is just a giant mess.

I wasn't part of the other discussion, what the hell is the point 
of having a discussion if you can't change the subject.

> We are now nowhere near the original topic. I'll cut this off 
> at the knees and say If you want @nogc RAII containers that 
> work with std.allocator then just use 
> https://github.com/economicmodeling/containers

I feel like if your solution is, don't use Phobo's containers 
here use this person's that isn't updating it anymore of 
questionable quality. Then I feel like you are agreeing with me 
that phobos containers suck. Oh and it looks like hackerpilot is 
responsible for merging pull request, lovely.


More information about the Digitalmars-d mailing list