Proposal: Build Graph Exporter
As discussed in other channels, we would like to introduce a build graph exporter.
This command should emit BLUE’s DAG build graph for use in external tools.
Output Format
We still need to decide which output format to support initially:
- JSON is a straightforward option.
- If there is a well-supported graph visualizer on Linux, we could prioritize the format it expects.
Ideally, the exporter should be:
- User-extensible
- Configurable
Users should be able to:
- Choose the export format
- Extend available exporters
Graph Contents
The exported DAG should include additional metadata per node.
One of the most important data points is provenance tracking, allowing the user to:
- Click a graph node
- Jump directly to the code line that produced it (in BLUE, this corresponds to the
origin field).
Integration with External Viewers
- The viewer we support as a first-class citizen should respect the
$EDITOR environment variable, so clicking a node opens the user’s editor of choice.
- Launching the external viewer should be configurable via:
- A BLUE parameter:
program.viewer.graph
- An environment variable:
BLUE_PROGRAM_VIEWER_GRAPH
The graph must be interactive, so static approaches (e.g., Graphviz) are not suitable.
Build Snooping
We also want to support build snooping for visualizations like this:
Syscall build snooping
Two possible approaches:
LD_PRELOAD
- Fast
- Requires introducing C into BLUE (adds dependency on GCC toolchain)
- Cannot snoop static binaries
PTRACE
- Does not require introducing any external dependency
- Slow
- Messy
- Only one process can
ptrace another
Emacs Graph Viewer
We would also like to provide an Emacs graph viewer, but there is no solid foundation for such a tool yet.
We would likely rely on SVG manipulation for the implementation.
Inspirations from existing Emacs UIs:
Note: org-roam-ui is implemented in JS.
- Drawback: JS dependency
- Advantage: Portable (browser-based) and provides excellent interactivity
If we wanted something like that, it would be very nice to implement it in Scheme using Hoot which is supported on all major browser platforms since version 0.6.0.
## Proposal: Build Graph Exporter
As discussed in other channels, we would like to introduce a **build graph exporter**.
This command should emit **BLUE’s DAG build graph** for use in external tools.
### Output Format
We still need to decide which output format to support initially:
- **JSON** is a straightforward option.
- If there is a well-supported graph visualizer on Linux, we could prioritize the format it expects.
Ideally, the exporter should be:
- **User-extensible**
- **Configurable**
Users should be able to:
- Choose the export format
- Extend available exporters
### Graph Contents
The exported DAG should include **additional metadata per node**.
One of the most important data points is **provenance tracking**, allowing the user to:
- Click a graph node
- Jump directly to the code line that produced it (in BLUE, this corresponds to the `origin` field).
### Integration with External Viewers
- The viewer we support as a first-class citizen should respect the `$EDITOR` environment variable, so clicking a node opens the user’s editor of choice.
- Launching the external viewer should be configurable via:
- A BLUE parameter: `program.viewer.graph`
- An environment variable: `BLUE_PROGRAM_VIEWER_GRAPH`
The graph must be **interactive**, so static approaches (e.g., Graphviz) are not suitable.
### Build Snooping
We also want to support **build snooping** for visualizations like this:
[Syscall build snooping](https://danielchasehooper.com/posts/syscall-build-snooping)
Two possible approaches:
**LD_PRELOAD**
- Fast
- Requires introducing C into BLUE (adds dependency on GCC toolchain)
- Cannot snoop static binaries
**PTRACE**
- Does not require introducing any external dependency
- Slow
- Messy
- Only one process can `ptrace` another
### Emacs Graph Viewer
We would also like to provide an **Emacs graph viewer**, but there is no solid foundation for such a tool yet.
We would likely rely on **SVG manipulation** for the implementation.
Inspirations from existing Emacs UIs:
- [org-supertag](https://github.com/yibie/org-supertag)
- [org-timeblock](https://github.com/ichernyshovvv/org-timeblock)
- [grid.el](https://github.com/ichernyshovvv/grid.el)
- [org-graph-view](https://github.com/alphapapa/org-graph-view)
- [hyperdrive.el](https://git.sr.ht/~ushin/hyperdrive.el)
- [org-roam-ui](https://github.com/org-roam/org-roam-ui)
- [boxy](https://gitlab.com/grinn.amy/boxy)
Note: [org-roam-ui](https://github.com/org-roam/org-roam-ui) is implemented in JS.
- Drawback: JS dependency
- Advantage: Portable (browser-based) and provides excellent interactivity
If we wanted something like that, it would be very nice to implement it in Scheme using [Hoot](https://spritely.institute/hoot) which is supported on all major browser platforms since version [0.6.0](https://spritely.institute/news/guile-hoot-0-6-0-released.html).
---