A betterC base

Dave Jones dave at jones.com
Fri Feb 9 15:48:46 UTC 2018


On Thursday, 8 February 2018 at 18:06:38 UTC, Walter Bright wrote:
> On 2/8/2018 9:03 AM, Dave Jones wrote:
>> If D had a decent garbage collector it might be a more 
>> convincing argument.
>
> 'Decent' GC systems rely on the compiler emitting "write gates" 
> around every assignment to a pointer. These are justified in 
> languages like Java and Go for which everything is GC 
> allocated, but they would be a performance disaster for a 
> hybrid language like D.
>
> More precise GC exacts heavy runtime penalties, too, which is 
> why attempts to add them to D have had mixed results.

When even you make excuses for the sub standard garbage 
collection how can anyone expect to use it as a positive selling 
point for D?

That's my point, that the current GC is not something that will 
sell many tickets to the show. Whether there are good reasons for 
it being so is kind of beside the point.


> I.e. it isn't an issue of us D guys being dumb about the GC.

I have no doubt about that.


>> If going malloc didnt lose you a bunch of features and bring a 
>> bunch of other stuff you need to be careful of, that might be 
>> a good argument too.
>
> With @nogc, you don't have to be careful about it. The compiler 
> will let you know.

I mean more mixing GCed and malloc memory. If you want to use 
malloc and still use language features that need GC, you still 
need to be aware and think about whether any of malloced stuff 
needs to be registered with the GC.

IE. It's not just a case of "hey just use malloc".






More information about the Digitalmars-d mailing list