Plan for D

Bastiaan Veelo Bastiaan at Veelo.net
Sun May 16 12:42:44 UTC 2021


On Sunday, 16 May 2021 at 10:50:38 UTC, Johan Engelen wrote:
> On Sunday, 16 May 2021 at 03:58:15 UTC, Mike Parker wrote:
>> On Sunday, 16 May 2021 at 03:46:50 UTC, Ola Fosheim Grostad 
>> wrote:
>>
>>>
>>> The fact that dmd does not ship with GC enabled speaks 
>>> volumes...
>>
>> Hardly. dmd doesn't release memory, either. Does that "speak 
>> volumes" about free? Neither is suitable for Walter's 
>> performance goals with dmd. That's precisely why D allows you 
>> to disable or avoid the GC when you need to.
>
> Hi Mike,
>   I have to agree with Ola on this point.

I have trouble following an argument between people that I feel 
should know better than me that the premise is false.

Ola's statement that

> dmd does not ship with GC enabled

is false, given the 
[-lowmem](https://dlang.org/dmd-windows.html#switch-lowmem) 
compiler option:
> -lowmem
>    Enable the garbage collector for the compiler, reducing the 
> compiler memory requirements but increasing compile times.

So dmd *as shipped* can be used with and without the GC, the 
default being fast. You've got to have a default.

So before taking this further, I'd suggest arguing about the 
effectiveness of -lowmem, and whether the GC at all can be blamed.

1. Usually the prime argument against a GC is speed. So, if one 
wants to prove that the GC leads to unacceptable delays then 
demonstrate that compile times with -lowmem take considerably 
more time than compilers that use manual memory management. Try 
to come up with a comparable case, like C-like betterC and C. If 
the argument is that important, it shouldn't be hard to make an 
indisputable case.
2. A secondary argument is that the GC claims more memory than 
when memory is released by hand. We know that memory usage can be 
very high even with -lowmem, but that is much more likely to be 
due to template instantiations and ctfe than due to uncollected 
memory. Again, it shouldn't be hard to demonstrate whether the GC 
can be blamed substantially or not.

Until i see this demonstrated, the argument goes on the 
GC-whiners pile for me...

-- Bastiaan.


More information about the Digitalmars-d mailing list