Phobos import graph

Nick Sabalausky a at a.a
Tue Jun 8 18:12:04 PDT 2010


"Philippe Sigaud" <philippe.sigaud at gmail.com> wrote in message 
news:humcf2$2ufd$1 at digitalmars.com...
> Hi,
>
> reading the std.all threads, I got curious as to how the different
> Phobos modules import each other. A dependency graph, if you will,
> though I'm sure to use that in a correct way.
>
> Funnily, I wrote yesterday an importGraph function that, given a
> module name and an optional directory where DMD is installed,
> crawls the module, find import statements and recursively calls
> itself with these new modules, building an import graph at the same
> time. It's mostly made to give a dependency graph for a project,
> but could be used on Phobos.
>

Neat!

> So, I created a stdall module importing all Phobos and got my
> function to graph it (btw, it's cool to see it can read and kind-
> of-parse all of Phobos and core in a few tens of ms).
>
> For those interested, the result is there:
>
> http://www.dsource.org/projects/dranges/browser/downloads/Phobos_gr
> aph.pdf
> (thanks graphviz)
>

Heh, that looks like some of my breadboard projects ;)




More information about the Digitalmars-d mailing list