Garbage Collection for Systems Programmers
bachmeier
no at spam.net
Thu Apr 4 16:06:35 UTC 2024
On Thursday, 4 April 2024 at 15:42:24 UTC, ryuukk_ wrote:
> There is no anti-GC crowd
>
> I will not speak for other people, so i will speak for myself
There's definitely an anti-GC crowd. Most of them don't use D,
but they're happy to vandalize discussions about D.
> I advocate for: GC as a library and core language as pay as you
> go, so i can use a great language without people making it
> annoying to use
> Imagine:
>
> ```D
> int[] myarray;
> create_array(allocator, myarray, length: 16);
>
>
> int[int] mymap;
> create_map(allocator, mymap)
>
>
> // or fall back to using GC for casual scripting
> ```
But once you have to "fall back" to the GC, you've lost anyone
that wants to do scripting.
> No need to pick a clan, be smart, enable people
But in your example, you have picked a clan, those that enjoy
dealing with memory management.
> The absolute best is what Zig is doing by encouraging people to
> use/request for an allocator
Why would I care about an allocator? These are the specs of the
computer that will run my program:
Memory: 125.5 GiB
Processor: 13th Gen Intel® Core™ i9-13900 × 32
If I want to write a program that changes a few lines in a
markdown file, for instance, there's no reason to introduce
overhead.
> Question to pro-GC crowd, why does it take 2 seconds to create
> the array?
Why are you using the GC if that's the code you need to write?
Although if I'm writing a script and it's run one time once a
day, even that isn't a big deal.
More information about the Digitalmars-d
mailing list