Debugging tools today tend to be language-specific, require lots of knowledge of the internals of a language runtime, and therefore to be quite complex. The focus is on debugging heavyweight programs with low overhead, and the predominant paradigm is to slow time down and permit stopping at specific lines (breakpoints). Time-travel debugging remains esoteric, as do user-configurable views of datatypes.
A complementary approach is debug by print. It requires no tooling support and naturally lays out a program run over time. However, you have to choose to either clutter up your codebase with debug prints (maybe disabled) or delete them and re-add them every time, which makes it harder to disseminate debugging tricks with your collaborators. It also doesn't permit other media.
This project makes debug by print more ergonomic by adding a little bit of structure to source code that tooling is aware of:
-
lines in source code can have an optional fold character. Text after the fold character (debug prints in green below) is hidden by default in the editor, and expanded on demand.
-
If programs provide instructions for interpreting patterns in log lines, the editor can render log lines graphically, making lots of dense information easy to read at a glance. Here are example logs for a Pong game:
-
If programs follow a specific convention for section headings, the editor folds section contents away and lets people drill into sections on demand.