cycle dependencies

Simen Kjærås simen.kjaras at gmail.com
Sat Jun 2 21:13:12 UTC 2018


On Saturday, 2 June 2018 at 17:17:02 UTC, Neia Neutuladh wrote:
> On Friday, 1 June 2018 at 17:59:21 UTC, Steven Schveighoffer 
> wrote:
>> The .di file is just an interface, it doesn't know what's 
>> actually compiled in the binary.
>>
>> To put it another way, the compiler only generates a 
>> ModuleInfo (or dependency modules) for .d files. .di files are 
>> simply a public API for the .d files.
>
> Yes, this is my point. (Communication is much harder than I 
> thought.)
>
> When you encounter a .di file, you can't rely on an automated 
> tool to tell you what modules need to be initialized or figure 
> out an order for them. You have to do it manually, and if you 
> mess it up, you get undefined behavior.

I believe Steve's point was that with the suggested json file 
describing dependencies, that would be a part of the public 
interface, and so would be distributed alongside .di files. Of 
course, someone could forget to distribute those, and in such a 
case the runtime cycle test could be extended to do the 
conservative test if the compiler hasn't registered all modules 
as having json info.

--
   Simen


More information about the Digitalmars-d mailing list