Skip to content
Hacker News front page

AST-grep Rewrote Tree-sitter's Core in Rust, Parsing Is 30% Faster

How AST-grep Rewrote Tree-sitter in Rust and Made It 30% Faster

AST-grep rewrote Tree-sitter's C parsing core in Rust, with AI generating most of the code. Raw parsing throughput is up ~30%, and end-to-end ast-grep outline runs are 22% faster, at the cost of ~8 MiB more memory. The rewrite drops incremental parsing and WASM loading, targeting AI coding agents that analyze full file snapshots. The post notes an early version peaked above 1 GiB on a TypeScript stress corpus; the final build peaks at 91.2 MiB.

Why it matters: AST-grep rewrote Tree-sitter's C parsing core in Rust, parsing files about 30% faster and full tasks 22% faster, at the cost of roughly 8 MiB more memory.

Read the original ↗Export Markdown