Hi All,
I recently came across mix xref graph
which shows how application files depend on one another by printing the application dependency graph. I find this graph extremely useful.
As a noob, I spend a lot of time reading source code on GitHub, usually I’m dissuaded by the challenge of navigating through the source code and finding relationship between the various modules; I’ve to clone and generate xref graph
locally for easily navigation.
I’ve been wondering if there’s a downside in adding this graph to every project to aid for easily navigation/discovery of the relationship between various modules.
Thank you.
Well, that’s IMO not the complete picture. You can see compile-time and run-time dependencies but that’s not a semantic graph in the sense of “module X absolutely needs module Y” and it will still show you cases of “module A needs module C only because module B (on which A depends) needs it” – which might not be of an immediate interest when analyzing and trying to understand a project.
I’ll agree that mix xref
in general is super useful though. Helped me reduce compile times on a few occasions.
You can see compile-time and run-time dependencies but that’s not a semantic graph in the sense of “module X absolutely needs module Y” and it will still show you cases of “module A needs module C only because module B (on which A depends) needs it”
I thought in transitive cases; a link from A to B and B to C will be shown and not A to C
Helped me reduce compile times on a few occasions.
Can you throw more light on this point, I thought the compiler handles this automatically or the context is different.
Apologies, this requires quite the dedication to extract and demonstrate and I am not willing to invest as much effort and time into it now.
But I have this one relatively new link that might start you off: Thinking Elixir Podcast 60: Compile Faster with Marc-André Lafortune
2 Likes