Why is D's GC slower than GO's?

Templated Person temp at no-mail.com
Sun Oct 30 23:38:56 UTC 2022


On Sunday, 30 October 2022 at 22:36:15 UTC, Walter Bright wrote:
> That's exactly like ownership/borrowing. D does it in @live 
> functions.

I don't understand why is it not a goal to replace the GC with 
Swift / Nim-like reference counting. Stuff like `@live` already 
is in the works and can be used to optimize some reference count 
operations away.

Did you already consider and rejected this approach?

You may also want to read this document: ["Memory Management in 
Lobster"](https://aardappel.github.io/lobster/memory_management.html). See the "Ownership Analysis" header specifically.

I think this approach can finally rid us of endless GC 
bikeshedding, plus most people would be okay with reference 
counting at kernel level. Only thing to worry about is reference 
cycles, Nim solves that using tracing and Swift solves that using 
weak pointers.


More information about the Digitalmars-d mailing list