Cherry on top for redub: looking for a module import analyzer

max haughton maxhaton at gmail.com
Wed Jul 31 21:56:49 UTC 2024


On Wednesday, 24 July 2024 at 12:29:37 UTC, Hipreme wrote:
> It is possible to make root builds way faster, specially for 
> those which contains a lot of code. That being said, I would 
> need an implementation of import analyzing library.
>
> It should work as simply as: send a source file path and import 
> paths then  it returns: the imported files by this file which 
> it were found on:
>
> ```d
>
> struct SourceFile
> {
>     string importPath, string sourcePath;
> }
>
> SourceFile[] getDependencies(string inputFile, string[] 
> importPaths);
>
> ```
>
> If that kind of work has been done in this area, I could do an 
> improvement to redub.
> Keep in mind that this is not a guaranteed improvement since 
> the time it needs to analyze the imports can't be greater than 
> the time won by using object files.

In general you can't really do this because of string mixins. In 
practice you can get obviously get quite close.


More information about the Digitalmars-d mailing list