Using D

Mike via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 11 17:10:29 PDT 2014


On Friday, 11 July 2014 at 19:46:25 UTC, Walter Bright wrote:
> I agree that the GC phobia is way, WAY, overblown for practical 
> programming.

I agree with this, as well, but it's a generalization.

There are some applications that the current GC is not suitable 
for, but D provides a plethora of features for disabling the GC 
or managing memory in other ways (very cool), so I don't see a 
reason to not use D even for the most demanding problem.  I love 
the GC for some things I do, but can't use it for other things I 
do.  For the vast majority of applications I see people using D 
for, however, I see no reason why there should be any worry about 
the GC.

The problem, however, when managing one's own memory is that one 
cannot use some of the built-in types, like Exceptions, that are 
instantiated deep within the runtime.  A solution to this would 
likely quiet some of the clamoring, IMO.

I would be interested in hearing any suggestions for disabling 
the GC and still making use of Exceptions, dynamic arrays, etc... 
using a user-supplied memory manager.  Maybe something like this 
already exists, and people like me just aren't aware of it.

Being a novice still, I don't know what the solution is.  At the 
moment I exploring region-based memory management (nice example 
at http://en.wikipedia.org/wiki/Region-based_memory_management).  
I also saw some proposals for something like 
gc.pushAllocator(myAllocator)/gc.popAllocator(), which would be 
nice.

Mike




More information about the Digitalmars-d mailing list