cycle dependencies

Neia Neutuladh neia at ikeran.org
Fri Jun 1 15:42:00 UTC 2018


On Friday, 1 June 2018 at 12:50:31 UTC, Steven Schveighoffer 
wrote:
>> A fly in the ointment is .di files. This works today and does 
>> the right thing:
>
> This actually is not a problem, because the dependency tree 
> doesn't depend on whether the imported module has static ctors. 
> It's how this works today -- each module only knows whether the 
> modules has static ctors, and what imports it has. It doesn't 
> go further than that.

Thanks to .di files, when I compile my executable, I don't always 
know which modules import which other modules. That was half the 
point of my example.

Are you talking about giving the initialization order for a 
subset of modules? Because that wouldn't give much of a speed 
increase. Or do you need all of your dependencies to have their 
own dependency order, and the compiler can concatenate them?

As an alternative, you could produce the initialization order by 
running the program and seeing what order it uses.


More information about the Digitalmars-d mailing list