cvogt / cbt

CBT - fun, fast, intuitive, compositional, statically checked builds written in Scala
Other
488 stars 60 forks source link

Visualize task graph (maybe even animated) #351

Open cvogt opened 7 years ago

cvogt commented 7 years ago

It seems that one of the reasons why people struggle with build tools is that builds are generally graphs of dependent tasks that do not have a regular structure (as opposed to binary trees of ints, or else). And large structures that aren't regular are hard to learn and keep in your head. This could also be one of the reasons why git is considered to have a steep learning curve. Understanding the graph makes all the difference.

Since it is not regular, the graph has to be learned one node at a time. Easy of learning and understanding the graph seems to be a major factor in usability of a graph based tool such as a build tool. In a build tool there are actually two graphs, which are somewhat related. On the high level a graph of modules depending on each others (modules being libraries or local code bases). And lower level tasks such as compile related to individual modules.

CBT could likely gain a lot of usability by visualizing it's task graph and the higher-level module graph in an easily exploratory way, maybe even in an animated way that shows in real time what is happening when executing a task (maybe with a slow down feature to still allow understanding tasks that finish very quickly). It could look somewhat like a class diagram of the BaseBuild and plugins and how they relate to each other. You'd probably need on of these per module (with the class diagrams for maven dependencies being much smaller than those of local builds). Within each class and even across the inheritance, we could visualize the call graph.

In order to create the graph, we could use Scala Meta to analyze the source code, graphviz/dot, D3 or viz.js to visualize the graph and either augment the Scala code via Scala Meta source transformation or manual augmentation via method calls to communicate the current position in the graph for animation.

cvogt commented 7 years ago

related info on how to do nested hierarchies/networks/graphs in js https://bl.ocks.org/mbostock/7607535 http://stackoverflow.com/questions/7034/graph-visualization-library-in-javascript http://manual.cytoscape.org/en/stable/Creating_Networks.html http://js.cytoscape.org/