Garbage Collector

Konstantin via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 15 06:19:31 PDT 2016


Started learning D. Like the language. However, found several 
people complaining about garbage collector’s reliability and 
performance. For me it’s a showstopper.

I don’t believe a community is capable of creating a good GC. 
It’s just too complex engineering task. It’s been a known problem 
for years, still no solution.

Since recently, Microsoft’s .NET framework and runtime are open 
source under MIT license. Here’s the main parts of their GC:  
https://github.com/dotnet/coreclr/tree/master/src/gc As you see, 
it’s in C++, and contains 10-20 times more code, then D’s GC. 
Theoretically, it should be cross-platform: there’re build 
instructions for Linux (including ARM), OSX, and BSD; but I 
haven’t tried building on those.

Has anyone thought about taking GC from .NET and reusing it in D?

That GC is very efficient for wide range of applications. I’ve 
been using .NET since 3.0 on desktops, servers, embedded and 
mobiles, never had issues with GC, it just works, and the 
performance is good.

I don‘t know architectural details of either GC.

I perfectly aware it might happen so they are completely 
incompatible, or very hard to port: because .NET’s System.Object 
vs. D’s Object differences; because D’s fibers or just very 
different threading model; because different CRT; many other 
reasons possible.

But if we’re lucky, this GC could lead to a great improvement for 
D ecosystem, not costing too much time. IMO that is something 
doable by a single person in a spare time.

Thoughts?


More information about the Digitalmars-d mailing list