DIP10005: Dependency-Carrying Declarations is now available for community feedback

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Sat Dec 24 16:43:59 PST 2016


On Sat, 24 Dec 2016 14:03:26 -0500, Andrei Alexandrescu wrote:
> * Your post provided no description of the methodology used beyond
> "relatively simple regex" to come up with the magic number 26, so I
> tried to use interpretation.
> 
> * There is no answer to "where is cmp on that list for example?" to shed
> light on what 26 is about.

You mentioned that in another branch of the conversation. It took some 
time for me to get to it. I'm a human.

>> In part, you are assuming that imports on non-template declarations
>> will be handled lazily, even though that is not part of this DIP, even
>> though that is likewise possible with static and selective imports.
> 
> Imports in non-template declarations ARE handled lazily when those
> non-templates are imported. Consider:

...

Y'know, I make assumptions, but I tend to test them. But that kind of 
depends on me writing valid tests, and in this case, I didn't.

My face is egged, and I concede.

Thank you for providing example code. That cleared everything up very 
fast.

With this new understanding, most modules become nearly free to import 
under your proposal. It does require a lot of work to get there, but on 
the plus side, it should be possible to automate that with a tool. I'd be 
willing to add that to my build process for anything I publish if it'll 
help others.

>> In part, you are using lines of code as a proxy for compile time.
> 
> What do you suggest to use?

You did write a script to check compile times for importing individual 
phobos modules.

>>> The findings of DIP1005 are the following:
>>>
>>> * Importing a single std module also imports on average 10.5 other
>>> modules.
>>
>> Seems reasonable. Between 2 and 3.5 direct dependencies, by my count,
>> and you're counting transitive dependencies.
> 
> Shouldn't I? Shouldn't you?

I was agreeing with you. At the time, I didn't have a convenient way to 
check the number of transitive dependencies of a module.

>> We're concerned with the effects of DIP1005, though, which only affects
>> template constraints.
>>
>>> * Importing a single std module costs on average 64.6 ms.
>>
>> 55-ish for your hardware, you reported elsewhere. 47-ish for mine.
> 
> Let's stick with the numbers published in the DIP.

Sure. You insinuated that I should run your script to verify your 
numbers, so I did.


More information about the Digitalmars-d mailing list