Inherent code performance advantages of D over C?

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Dec 6 16:25:05 PST 2013


On Sat, Dec 07, 2013 at 01:09:00AM +0100, John Colvin wrote:
> On Friday, 6 December 2013 at 23:56:39 UTC, H. S. Teoh wrote:
> >
> >It would be nice to decouple Phobos modules more. A *lot* more.
> 
> Why? I've seen this point made several times and I can't understand
> why this is an important concern.
> 
> I see the interplay between phobos modules as good, it saves
> reinventing the wheel all over the place, making for a smaller,
> cleaner standard library.
> 
> Am I missing something fundamental here?

It's not that it's bad to reuse code. The problem is the dependency is
too coarse-grained, so that if you want to, say, print "hello world", it
pulls in all sorts of stuff, like algorithms for sorting arrays (just an
example, not the actual case), or floating-point format parsers (may
actually be the case), which aren't *needed* to perform that particular
task. If printing "hello world" requires pulling in file locking code,
then by all means, pull that in. But it shouldn't pull in, say,
std.complex just because some obscure corner of writeln's implementation
makes a reference to std.complex.


T

-- 
People tell me I'm stubborn, but I refuse to accept it!


More information about the Digitalmars-d mailing list