rand/calligrapher
A high-performance, modular static analysis tool written in Zig that generates enriched call graphs for multiple programming languages using tree-sitt...
Calligrapher is an experimental static analysis tool written in Zig. The goal is to build enriched call graphs by combining tree-sitter based parsing with a language-agnostic resolution layer. The codebase already contains scaffolding for the core graph types, parser bindings, a Python extractor, and a CLI, but most modules still rely on stubs while we validate the architecture.
Status – October 2025: We are executing the M0 "Codebase Validation" milestone defined in
PROJECT_PLAN.md
. The immediate focus is on reactivating grammar-independent tests, auditing the tree-sitter bindings, and preparing fixtures for the Python MVP.
src/core/
) with lifecycle tests.zig test
without a grammar loaded.build.zig
.See STATUS.md
for a detailed breakdown of the M0 backlog.
Install Zig 0.13.0 or later.
(Optional for now) Install the tree-sitter C library and the Python
grammar. The build defaults to a stubbed implementation, but passing
-Duse_tree_sitter_stub=false
requires the following options:
zig build -Duse_tree_sitter_stub=false \
-Dtree_sitter_include=/path/to/tree-sitter/include \
-Dtree_sitter_lib=/path/to/tree-sitter/lib
The build script will fail fast with a helpful error message if the paths are missing.
Clone and build:
git clone https://github.com/yourusername/calligrapher.git
cd calligrapher
zig build
The repository ships with several module-level test suites. They run entirely against the stubbed grammar implementation so they pass even before native bindings are available.
zig build test
To exercise a specific module:
zig test src/extractors.zig
zig test src/parser.zig
Fixtures live under examples/
. M0 adds a minimal Python project
with an accompanying golden call graph snapshot that will anchor future
integration tests once the extractor is wired to the real grammar.
examples/
└── python/
└── minimal/
├── project.py
├── expected_call_graph.json
└── README.md
PROJECT_PLAN.md
– Delivery roadmap and weekly backlog.PLAN.md
– Architectural context and long-term goals.STATUS.md
– Live milestone tracking.docs/parser_binding_audit.md
– Latest review
of the tree-sitter bindings.As milestones close we reconcile these documents to keep onboarding material current.
Contributions are welcome! During M0 we are prioritising:
Please open an issue or PR referencing the relevant milestone item in
PROJECT_PLAN.md
.
Calligrapher is distributed under the MIT License.