cycle dependencies

Steven Schveighoffer schveiguy at yahoo.com
Wed May 30 18:49:40 UTC 2018


On 5/30/18 11:50 AM, Stefan wrote:
> On Wednesday, 30 May 2018 at 13:26:53 UTC, Steven Schveighoffer wrote:
>> On 5/30/18 8:09 AM, DigitalDesigns wrote:
>> ... it's really really hard to make it check real dependencies.
> 
> 
> For serious dependency checking, you could try 
> https://github.com/funkwerk/depend.
> It's used in quite large commercial projects.

OK, so a couple things:

1. The cycle checking has to be really really fast, and run in a small 
amount of memory. It runs on startup of EVERY D program. I would LOVE to 
get rid of this problem, but unless we either invent our own 
object/linker system, or create some tools to work on the linked binary, 
we have to do this.

2. The cycle algorithm is fast and works correctly, given the 
dependencies that the compiler has provided. It's really not the cycle 
algorithm that is the problem, but the determination of dependencies. In 
other words, the problem is the compiler not tracing all the actual 
dependencies and outlining that in some structure to be parsed later 
during program startup.

As you increase the number of dependency points, and therefore the graph 
size, the cycle algorithm has to take longer to figure out if there are 
any cycles. So even if we can fix the problem outlined here, the cost 
may not make it worth the effort!

There are some ideas Martin and I have fleshed out a bit, which would 
help reduced the cyclic dependencies, but so far, nobody has had the 
time and/or skills to implement. For instance:

https://issues.dlang.org/show_bug.cgi?id=16265
https://github.com/dlang/druntime/pull/1602#issuecomment-231527759

-Steve


More information about the Digitalmars-d mailing list