News for hackers. Stuff that matters.
Re:Difftastic, a structural diff tool that understands syntax by fiddlerwoaroof on Thursday March 21, 2024 @10:11PM (#39786770)
The main issue I have with tree-sitter is that it’s approach can’t work for many languages I care about: Common Lisp cannot be parsed without a full lisp implementation; Haskell’s syntax is complicated enough that the grammar is incomplete; C/C++ can’t be parsed accurately if only because of the pre-processor; parsing perl is Turing-complete, etc. I think the suggestion elsewhere makes sense: don’t make us write parsers in a new ecosystem, but instead define a format for existing parsers to produce as a side-output.
Re:Difftastic, a structural diff tool that understands syntax by gwd on Friday March 22, 2024 @06:27AM (#39789185)
> C/C++ can’t be parsed accurately if only because of the pre-processor

Yeah, decided to check this out to see if it could help review in our massive C-based project. Unfortunately, in a recent patch, of the 90 "hunks", 88 of them had fallen back to "normal diff" because "$N C parse errors, exceeded DFT_PARSE_ERROR_LIMIT").

Re:Difftastic, a structural diff tool that understands syntax by amelius on Friday March 22, 2024 @09:25AM (#39790492)
C++ also can't be parsed like that because you need to process a declaration before you know what role a symbol plays in the grammar.