Frameworks and libraries

Atila Neves atila.neves at gmail.com
Fri Sep 15 20:38:12 UTC 2023


On Friday, 15 September 2023 at 16:40:38 UTC, monkyyy wrote:
> On Friday, 15 September 2023 at 16:09:44 UTC, bachmeier wrote:
>> On Friday, 15 September 2023 at 14:50:27 UTC, monkyyy wrote:
>>> d as is, is gc'ed to hell and back
>>
>> That's why I use it.
>>
>>> nogc is a bandaid to advertise its something its not.
>>
>> [This is what the spec 
>> says](https://dlang.org/spec/function.html#nogc-functions). I 
>> don't see anything wrong with it. It restricts what you can do 
>> inside a function and that's what it's supposed to do.
>
> a language includes its std and there's no alternative for std: 
> string, algorithm, range to be nogc'ed

std.string, I get, but algorithm and range are poster children 
for `@nogc`. I'm not going to claim that *nothing* in those 
packages allocates on the GC heap, but I'd be very surprised if 
there were many functions that did.

Which is good because allocating when not needed is silly, not 
because avoiding the GC is a good idea. It isn't. *If* your 
program is slow *and* you profiled *and* it's GC allocation 
that's slowing it down, then think about doing something else.




More information about the Digitalmars-d mailing list