Early exit error messages are unsustainable

FeepingCreature feepingcreature at gmail.com
Wed Aug 14 06:50:11 UTC 2019


On Tuesday, 13 August 2019 at 22:36:09 UTC, Ethan wrote:
> On Tuesday, 13 August 2019 at 21:00:38 UTC, Ethan wrote:
>> Which leads me to the recursive expansion. Because whatever's 
>> going on wherever in my code, the compiler knows there's a 
>> problem and is refusing to tell me.
>
> Finally compiling and linking.
>
> Whatever the problem is, it's not liking circular imports in my 
> code.
>
> Not that it bothered to tell me that.

Circular imports and circular dependencies have always been a 
minefield. They *work*, sort of, but not always reliably. A whole 
bunch of bugs have taken the form "I've used a circular 
dependency to confuse the compiler into treating a type as 
finished when it wasn't actually done figuring it out yet", 
especially around concepts like inspecting a type from a mixin 
template inside the type, and things like that.

As a language, D is always torn between "I want to take on big 
challenges and become more powerful!" and "Why did I do that! I 
regret that decision immediately!" Unfortunately, it's very hard 
to say "no, we've bit off too much complexity here, we should 
forbid this kind of construct." The temptation will always be to 
say "let's just focus on this next bug, this feature can work if 
we just fix all the issues with it" and ignore the fact that this 
many issues are a warning sign that a feature doesn't fit cleanly 
into the rest of the design.



More information about the Digitalmars-d mailing list