Garbage Collection for Systems Programmers

Hipreme msnmancini at hotmail.com
Tue Apr 2 12:00:06 UTC 2024


On Monday, 1 April 2024 at 20:45:25 UTC, Adam Wilson wrote:
> On Monday, 1 April 2024 at 01:58:51 UTC, Lance Bachmeier wrote:
>> On Sunday, 31 March 2024 at 14:22:43 UTC, Adam wrote:
>> The first question to ask is "Does it matter one way or the 
>> other?" Since you're probably not writing the Linux kernel, 
>> even if you're engaged in 'systems programming', the answer is 
>> quite often no. If the answer is yes, the second question to 
>> ask is "Does it matter enough?"
>>
>> I dislike these debates because most of those arguing against 
>> the GC are insufficiently informed to engage in a worthwhile 
>> debate. Many of them don't even understand that you can do 
>> things with a programming language other than write video 
>> games.
>
> The discourse around the GC has gotten so ridiculous that I 
> have seriously considered asking Walter to declare that "If you 
> want to create an OS or Video Game, consider a different 
> language."
>
> OS/Games is actually a fairly uncommon use of D, if you look at 
> what the people who aren't whining endlessly about the GC are 
> actually doing with it.
>
> Personally, I blame the OS/Game crowd for single-handedly 
> keeping D out of the web service space for the past *decade* 
> because, instead of improving the GC to the point that 
> long-running processes are possible, we've built a mountain of 
> (mis)features designed to assuage their demands. I maintain 
> that this was probably the second biggest mistake in D's 
> history.
>
> We need to accept a fact that I learned at DConf 2017, the 
> no-GC crowd will not be silenced until the GC is removed from 
> the language. However, Walter has said the GC is here to stay. 
> Therefore, the no-GC crowd will never be silenced. We've given 
> them a plethora of tools to work without the GC. It is time 
> that we stopped giving them so much our time. We have bigger 
> problems to solve.

As a Game Developer, I could not care less about nogc features. I 
have deliberately done the wasm runtime extension from Adam, to 
use an allocation only GC. Games can easily implement a 
game-level GC, where you can control game entities, their 
specific resources and deallocate them when you want.

Of course, I would prefer way more having a better GC in D. I 
have saw that a plenty of algorithms that uses memory allocation 
would perform better because we have GC pauses. I'm not saying 
that I should not be allocating GC memory. I'm saying that seeing 
such huge impact being done by the GC when I compare it to Java 
is quite saddening specially for the given effort. I had my own 
implementation of an `assert` like feature for my engine which 
used lazy parameters. My loop time reduced by about 80% (not a 
big game) by simply removing those lazy parameters because they 
were allocating every frame.


More information about the Digitalmars-d mailing list