I've documented several additional interesting challenges for syntactic diffing: meaningful comparisons of large string literals, understanding blank line changes, and autoformatters adding minor punctuation!
I've released difftastic 0.42! In this release:
* Faster textual diffing (over 10x if files have few lines in common!)
* There's now a syntactic diffing option --ignore-comments, for when you only want to see code changes
Syntactic diffing with interpolation is an interesting problem.
Same: 1 + 2 vs 1+2
Different: "1 + 2" vs "1+2"
Same: "#{1 + 2}" vs "#{1+2}"
Difftastic is smart enough to get the first two cases correct, but still considers the third case to be different strings.
It's amazingly awkward to print a syntactic diff correctly. Even the lines before and after the changes may not line up, if whitespace has changed!
Difftastic now inserts blank lines to help things line up. I'm reasonably happy with the result here.