OSNews article about C++09 degenerates into C++ vs. D discussion

Georg Wrede georg.wrede at nospam.org
Wed Nov 22 23:16:27 PST 2006


Mike Capp wrote:
> John Reimer wrote:
>>A standard non-gc based library is likely not
>>going to meet with massive approval from those
>>already in the community
> 
> I should clarify. I'm not proposing that the entire standard library should have a
> GC-less implementation, just that it should be as useful as possible without
> introducing GC usage when the user is trying to avoid it.
> 
> Crude analogy: imagine everything in Phobos being wrapped in a version(GC) block.
> Phobos is normally built with -version=GC, so no change for GC users. GC-less
> users use Phobos built without GC, so none of the library is available, which is
> where they were anyway.
> 
> Now, a GC-less user feels the need for std.foo.bar(). They look at the source, and
> find that std.foo.bar() won't ever use GC because all it does is add two ints, so
> they take it out of the version(GC) block and can now use it. Or they write a less
> efficient but GC-less implementation in a version(NOGC) block. Either way, they
> get what they want without affecting GC users. It's incremental, and the work is
> done by the people (if any) who care.

If DMD were an old fashioned shrink wrapped product, this would be 
solved by having a little note in the library documentation next to each 
Phobos function, stating whether GC {will|may|won't} get used.


(The last statement is not strictly correct, it should rather be 
something like "allocate from the heap", "GC-safe", or whatever, but the 
phrasing serves the point here.)


If somebody were to actually check Phobos, the obvious first thing to do 
is to grep for "new". But what's the next thing?



More information about the Digitalmars-d mailing list