2 ms·
Hi! ast-grep[1] author here. It is a tree-sitter based syntax tool to search tool. I wonder how you transition from tree-sitter to other builtin parsers? Tree-
by herrington_d 2y ago
Hi! ast-grep[1] author here. It is a tree-sitter based syntax tool to search tool.
I wonder how you transition from tree-sitter to other builtin parsers? Tree-sitter gave a unified interface to all languages. Using language native parsers will require significant work for various FFI if I am not wrong.
[1]: https://ast-grep.github.io/ https://ast-grep.github.io/
- alexpovel 2y agoNot the OP, but you raise good points. Performance might also be a concern, thinking of languages like Python and its ast package (not sure that’s accessible without going through the interpreter). For a tool I’m writing, the tree-sitter query language is a core piece of the puzzle as well. Once you only have JSON of the concrete syntax trees, you’re back to implementing a query language yourself. Not that OP needs it, but ast-grep might?
- herrington_d 2y agoYes, ast-grep already has its own rule syntax [1]. But still parser performance and binary size are critical factors for a general tool. https://ast-grep.github.io/guide/rule-config.html https://ast-grep.github.io/guide/rule-config.html