proposal: private module-level import for faster compilation

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 21 01:52:42 PDT 2016


On Wednesday, 20 July 2016 at 09:35:03 UTC, Dicebot wrote:
> I think this is a wrong approach patching a problem instead of 
> fixing it. Real solution would be to improve and mature .di 
> header generation and usage by compilers so that it can become 
> the default way to import packages/libraries.

As I see dependency resolution has function granularity, but 
headers have only file granularity. How do you expect headers to 
work on finer granularity level? If a module depends on another 
module, the header must assume it depends on all members of that 
module and if one member indirectly changes due to its private 
dependencies, it must be assumed that all depending modules must 
be recompiled, because they depend on the changed module even if 
they don't depend on the changed member and its private 
dependencies.

Not sure if tup can solve this problem. It can if it builds full 
dependency graph for each file instead of having one graph for 
the whole project.


More information about the Digitalmars-d mailing list