3 ms·
I didn't have much trouble writing tree-sitter parsers after taking a look to examples but I also resigned to writing my own parsers instead of using it. There
by a1o 3y ago
I didn't have much trouble writing tree-sitter parsers after taking a look to examples but I also resigned to writing my own parsers instead of using it.
There were two concerns I couldn't shake from using it.
1. In C-like languages you usually can do forward declarations, so you can opaquely define something, use it and have it properly defined later, usually due to how things need to use other things in their declaration. You can't cleanly do this in tree-sitter, you will need to handwrite some C code for this on top.
2. Even though the resulting parser is a single C-file, it still depends on some tree-sitter library and building it requires nodejs and npm packages. This means that anyone updating my C/C++ codebase has to also understand JS tooling. I would rather not have such dependency. If tree-sitter could have standalone tools that could be built only using either a C or C++ compiler, I would not have such a problem.