3 ms·
tree-sitter is an incredible tool. I wonder if there's been a dedicated discussion for it on the HN front page at some point—will have to check on the HN algoli
by danenania 2y ago
tree-sitter is an incredible tool. I wonder if there's been a dedicated discussion for it on the HN front page at some point—will have to check on the HN algolia search.
I'm using it for syntax checking across 30+ languages in Plandex[1], an LLM coding tool. tree-sitter runs in single digit milliseconds on typical files and is highly accurate. When it encounters a syntax problem, it can pinpoint the exact location/expression in the file, and it's fault-tolerant so it can keep going and identify multiple issues rather than stopping on the first one. These results can be sent back to the LLM, which can then often fix its own errors. I was able to reduce syntax issues by roughly 90% with gpt-4o using this approach.
Afaik, there's no other viable option for a use case like this. You'd need a menagerie of language specific linters, compilers, and/or language servers to get anywhere close, and many of those are way too slow to run inline.
1 - https://github.com/plandex-ai/plandex https://github.com/plandex-ai/plandex
- danenania 2y agoFound this discussion from 2021: https://news.ycombinator.com/item?id=26225298 https://news.ycombinator.com/item?id=26225298 This looks good too, from a year ago: https://news.ycombinator.com/item?id=36106421 https://news.ycombinator.com/item?id=36106421