Andrei's list of barriers to D adoption

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 7 19:04:06 PDT 2016


On Tue, Jun 07, 2016 at 07:00:13PM -0700, Charles Hixson via Digitalmars-d wrote:
> On 06/05/2016 09:17 PM, Adam D. Ruppe via Digitalmars-d wrote:
> > On Monday, 6 June 2016 at 02:30:55 UTC, Pie? wrote:
> > > Duh! The claim is made that D can work without the GC... but
> > > that's a red herring... If you take about the GC what do you have?
> > 
> > Like 90% of the language, still generally nicer than most the
> > competition.
> > 
> > Though, I wish D would just own its decision instead of bowing to
> > Reddit pressure. GC is a proven success in the real world with a
> > long and impressive track record. Yes, there are times when you need
> > to optimize your code, but even then you aren't really worse off
> > with it than without it.
> > 
> Usually correct, but there are times when you want to suspend the
> garbage collection.  The problem is this should always be a scoped
> decision, because it's easy to accidentally leave it turned off, and
> then it's MUCH worse than not having it.

	auto myFunc(Args...)(Args args) {
		GC.disable();
		scope(exit) GC.enable();

		doStuff();
	}

On another note, I have found that strategic disabling of the GC and/or
manually triggering GC.collect() at the right times, can give your
programs a big boost in performance, typically around 20% to 50%
depending on the specifics of your memory usage patterns. Arguably this
should be automatic once D's GC is replaced with something better than
the current implementation, but the point is that performance concerns
over the GC aren't insurmountable, and the fix is often not even that
complicated.

I think far too much energy has been spent arguing for a GC-less
language than actually writing the code that would fix its associated
performance issues, and my suspicion is that this is mostly caused by
your typical C/C++ programmer mindset (of which I used to be a part)
that's always obsessed about memory management, rather than any factual
basis.


T

-- 
It said to install Windows 2000 or better, so I installed Linux instead.


More information about the Digitalmars-d mailing list