<div class="gmail_extra"><div class="gmail_quote">On 28 April 2012 04:10, H. S. Teoh <span dir="ltr"><<a href="mailto:hsteoh@quickfur.ath.cx" target="_blank">hsteoh@quickfur.ath.cx</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sat, Apr 28, 2012 at 01:31:32AM +0200, SomeDude wrote:<br>
[...]<br>
<div class="im">> The other thing that would make it attractive among the C++<br>
> developers, would be the development of a lightweight, high<br>
> performance, minimal library that doesn't use the GC at all.  Ideally,<br>
> it would be compatible with Phobos. I bet if such a library existed,<br>
> flocks of C++ developers would suddenly switch to D.<br>
<br>
</div>I know the current GC leaves much room for improvement, but what's the<br>
hangup about the GC anyway? If -- and yes this is a very big if -- the<br>
GC has real-time guarantees, would that make it more palatable to C++<br>
devs? Or is it just because they have trouble with the idea of having a<br>
GC in the first place?<br></blockquote><div><br></div><div>If the GC guarantees to behave in a deterministic and predictable way, I have no problem with it. And even if it doesn't, as long as it's lightning fast, and I can control the sweeps.</div>
<div>One major concern to me is invisible allocations. I want to know when I'm allocating, I like allocate operations to be clearly visible. There are a lot of operations that cause invisible allocations in D, but they are avoidable.</div>
<div>Games are both embedded and realtime code at the same time, this unions the strict requirements of both worlds into a system that demands very tight control of these things. Fragmentation is the enemy, so is losing 1ms (GC takes WAY longer than this currently) at random moments.</div>
<div><br></div><div>There is a problem right now where the GC doesn't actually seem to work, and I'm seeing D apps allocating gigabytes and never releasing the memory.</div><div>A great case study for the GC is VisualD, if any GC experts would like to check it out. It shows a use case where the GC utterly fails, and makes the software borderline unusable as a result. It seems to 'leak' memory, and collects can take 5-10 seconds at a time (manifested by locking up the entire application).</div>
<div>VisualD has completely undermined by faith and trust in the GC, and I've basically banned using it. I can't afford to run into that situation a few months down the line.</div></div></div>