Current state of "D as a better C" (Windows)?

Adam D. Ruppe destructionator at gmail.com
Sat Jan 25 18:53:24 PST 2014


On Sunday, 26 January 2014 at 02:32:29 UTC, Frank Bauer wrote:
> Fine. Can I use it with Phobos?

Quite a bit of it, actually. There's significant parts of phobos 
which don't do allocation at all: std.algorithm and std.digest 
are two big parts that are pretty good about it.

> No it is not. It is part of the language. Every allocation 
> *inside* the language (i.e. with new) goes through the GC.

Not necessarily, you can change the allocation strategy if you 
want by providing your own function. _d_newclass is a major 
example.

The language sometimes makes tracking the reference really hard, 
for example, getting tho pointer to free with a closure is 
tricky, and tracking temporaries made with the binary concat 
operator. (You could perhaps do it but it would be really easy to 
lose a reference somewhere and leak it, I think binary concat 
should just be left unimplemented if you aren't using the gc (and 
avoided even if you are in any performance critical section)).

So yeah, it is possible to go without the GC with the D language 
by changing runtime functions but the language doesn't help you 
get it *right*.


More information about the Digitalmars-d mailing list