Re: cycle dependencies

2018-06-02 Thread Simen Kjærås via Digitalmars-d
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

Re: cycle dependencies

2018-06-02 Thread Neia Neutuladh via Digitalmars-d
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

Re: cycle dependencies

2018-06-01 Thread Steven Schveighoffer via Digitalmars-d
On 6/1/18 11:42 AM, Neia Neutuladh wrote: 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

Re: cycle dependencies

2018-06-01 Thread Neia Neutuladh via Digitalmars-d
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

Re: cycle dependencies

2018-06-01 Thread Steven Schveighoffer via Digitalmars-d
On 5/31/18 8:49 PM, Neia Neutuladh wrote: On Thursday, 31 May 2018 at 23:17:20 UTC, Steven Schveighoffer wrote: Hm... I just had a crazy idea: what if D had a switch that allowed it to store a dependency graph of constructors into a json file, and then when you link, there is a wrapper which

Re: cycle dependencies

2018-05-31 Thread Neia Neutuladh via Digitalmars-d
On Thursday, 31 May 2018 at 23:17:20 UTC, Steven Schveighoffer wrote: Hm... I just had a crazy idea: what if D had a switch that allowed it to store a dependency graph of constructors into a json file, and then when you link, there is a wrapper which consumes all these files, runs the cycle

Re: cycle dependencies

2018-05-31 Thread Steven Schveighoffer via Digitalmars-d
On 5/31/18 5:12 PM, David Bennett wrote: On Thursday, 31 May 2018 at 15:15:44 UTC, Steven Schveighoffer wrote: On 5/31/18 2:14 AM, Simen Kjærås wrote: On Wednesday, 30 May 2018 at 20:57:32 UTC, DigitalDesigns wrote: Why is this a runtime issue? It is not as if the execution of static this are

Re: cycle dependencies

2018-05-31 Thread David Bennett via Digitalmars-d
On Thursday, 31 May 2018 at 15:15:44 UTC, Steven Schveighoffer wrote: On 5/31/18 2:14 AM, Simen Kjærås wrote: On Wednesday, 30 May 2018 at 20:57:32 UTC, DigitalDesigns wrote: Why is this a runtime issue? It is not as if the execution of static this are non-deterministic. The compiler and

Re: cycle dependencies

2018-05-31 Thread Steven Schveighoffer via Digitalmars-d
On 5/31/18 2:14 AM, Simen Kjærås wrote: On Wednesday, 30 May 2018 at 20:57:32 UTC, DigitalDesigns wrote: Why is this a runtime issue? It is not as if the execution of static this are non-deterministic. The compiler and linker must order the calls in some way. Maybe this is what you mean by own

Re: cycle dependencies

2018-05-31 Thread Simen Kjærås via Digitalmars-d
On Wednesday, 30 May 2018 at 20:57:32 UTC, DigitalDesigns wrote: Why is this a runtime issue? It is not as if the execution of static this are non-deterministic. The compiler and linker must order the calls in some way. Maybe this is what you mean by own object/linker? But even then, they

Re: cycle dependencies

2018-05-30 Thread DigitalDesigns via Digitalmars-d
On Wednesday, 30 May 2018 at 18:49:40 UTC, Steven Schveighoffer wrote: 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

Re: cycle dependencies

2018-05-30 Thread Steven Schveighoffer via Digitalmars-d
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

Re: cycle dependencies

2018-05-30 Thread Stefan via Digitalmars-d
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

Re: cycle dependencies

2018-05-30 Thread Steven Schveighoffer via Digitalmars-d
On 5/30/18 8:09 AM, DigitalDesigns wrote: Seriously stupid bug here! I had an enum an static this() { } (empty, forgot why I added it) one module and an struct in another module that converted values from the enum. I imported only that enum and guess what?!?! Cycle dependency! removed the

Re: cycle dependencies

2018-05-30 Thread Andrea Fontana via Digitalmars-d
On Wednesday, 30 May 2018 at 12:09:21 UTC, DigitalDesigns wrote: Seriously stupid bug here! I had an enum an static this() { } (empty, forgot why I added it) one module and an struct in another module that converted values from the enum. I imported only that enum and guess what?!?! Cycle