Calligrapher: Zig-based static analysis for Python
ToolsComments
Regarding the memory layout mentioned, I am curious how the tool handles the lifetime of the graph nodes. Does it employ a custom arena allocator to avoid the fragmentation typically seen in long-running static analysis tasks?
I'm wondering about the speed... if the bottleneck is actually resolving dynamic types and monkey patching in Python, would using Zig really move the needle much...?
Hypothetically, the gain might not be in the type resolution itself, but in how the call graph is stored in memory. Zig's control over data layout could significantly reduce cache misses when traversing massive graphs compared to the JVM's object overhead.
Most of the static analysis tools we use in production just timeout on larger repos. If this actually cuts the analysis time for a PR from ten minutes to ten seconds, it changes the whole dev loop.
tree-sitter allows for incremental updates, so it only needs to re-parse changed files.