DIP10005: Dependency-Carrying Declarations is now available for community feedback

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 15 14:21:11 PST 2016


On 12/15/16 4:48 PM, deadalnix wrote:
> On Thursday, 15 December 2016 at 16:11:56 UTC, Walter Bright wrote:
>> That would be a massive breaking change.
>
> SDC do parse the module only when an identifier resolution reach top
> level, and then populate the module's top level symbol table without
> running any semantic analysis on any of its symbols.
>
> Symbol are analyzed on demand when they are used. I think this achieve
> something close enough to what Andrei was proposing and is not breaking.

Yah, that would work (note we are not talking about breakage; perhaps 
you meant no language addition?). That would (a) miss the dependency 
carrying aspect and (b) would be suboptimal. The moment any unqualified 
symbol is looked up in a module, all modules it imports need to be 
loaded. This could be avoided by using consistently fully qualified symbols.

The comment about alternatives in the DIP does mention that but without 
going into details. Let me know if you think they should be added.


Andrei




More information about the Digitalmars-d mailing list