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

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

I used AI to rewrite Tree-sitter's C core in Rust, achieving a 30% speed boost in parsing. While the new runtime is faster, it trades some memory efficiency for performance. This project proves that AI can handle complex system rewrites, turning a previously impossible task into a reality for structural code search tools like ast-grep.

It was a Herculean task wearing a header file.

More from this day

2026-07-26