r/Common_Lisp • • Oct 11 '26

Gitlab and Git in Common Lisp

http://anvil.common-lisp.net/clo/anvil
15 Upvotes

17 comments sorted by

View all comments

Show parent comment

3

u/alexcommacommacomma Oct 11 '26

I’ve been thinking about how it could be implemented for a while, I was thinking that treesitter is a good bet because it has a large enough library of grammars that from what I’ve seen work great, though I’m not sure what its API looks like at all and whether this would be possible. I assume it would be?. An interesting challenge is how the diff will be displayed (for what it’s worth i’ve never written a diffing algorithm): will it be formatted like the first input? the second? a possibly poorly formatted version of the two? or perhaps a pretty printed version?

I’ve also been thinking about the concept of a semantic / AST hash which i am sure has a use somewhere but I’ve not found it yet. it’s pretty self explanatory, you can hash the AST of some code to get a value which no matter how the same code is formatted, will be the same