July 26, 2026
Rust, rage, and a robot rewrite
How AST-grep Rewrote Tree-sitter in Rust and Made It 30% Faster
AI rewrote a coding engine, fans cheered the speed, critics asked what got cut
TLDR: A coding tool’s engine was rewritten in Rust with AI help, and the creator says it now runs noticeably faster. Commenters split between impressed and suspicious, arguing the gains may come from cutting famous features—and roasting the article’s AI-written vibe almost as hard as they debated the tech.
A developer says ast-grep used AI to rewrite the core of Tree-sitter—a widely used code-reading engine—in Rust, and the result is a big speed boost: about 30% faster at pure parsing and around 22% faster in the tool’s real-world workflow. That’s the bragging-rights version. The comments, naturally, were less interested in the victory lap than in what had to be sacrificed to get there.
The biggest drama came from readers side-eyeing the fine print. One commenter basically said, hold on, didn’t they remove the very feature Tree-sitter is famous for—the ability to reuse old work when a file changes? That sparked the core debate: is this a genuine upgrade, or a custom-built shortcut for a narrower job? Others piled on with the classic internet accusation that this is just another “Rust saves everything” story, with one blunt jab saying the article would read the same even if every mention of Rust vanished.
And then there was the comedy track. A reader joked that reading the piece felt like climbing a “load-bearing wall,” which is a wonderfully cursed review of the article’s prose. Another said they kept getting distracted by the mysterious AI-authored “I” voice—who exactly is talking when a bot helps write the code and the story? Still, not everyone came to boo: one fan called ast-grep a great tool for AI coding work and wished language models used it by default. So yes, the software got faster—but the comments turned it into a full-on identity crisis with popcorn
Key Points
- •The article says ast-grep rewrote Tree-sitter’s C core in Rust with AI assistance and benchmarked it against the original C runtime.
- •Raw parsing throughput increased by 29.74% versus the C baseline, while tree traversal throughput increased by 10.16%.
- •In ast-grep’s full outline workload, user CPU time fell from 1.233 s to 0.960 s, or about 22.2% faster end to end.
- •The Rust runtime used more memory: RSS rose in the full ast-grep run from 26.52 MiB to 34.43 MiB, and reached 91.2 MiB on a TypeScript stress corpus.
- •The article says the rewrite is not a drop-in upstream replacement: it keeps compatibility with existing generated languages and parsers but removes native WebAssembly language loading and incremental old-tree reuse.