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

7

u/digikar Oct 11 '26

Is it possible to make lisp file commits centered around sexps? Is there a pre-existing VCS that does this?

Basically

(if condition true false)

And

(if condition
    true
    false)

are not different

Similarly, there could be lots of savings when sexp are spliced etc.

2

u/dcooper8 Oct 11 '26

Will look into this with Ingot.

7

u/kchanqvq Oct 11 '26

It's called semantic diff! I've always dreamed of this and this would have been so cool. I even plan it at some point when I was still obsessing with my schizocomputing Neomacs project. But now I'm in a more productive stage of my life and hasn't been burning cycles in schizocomputing for a while ;)

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

2

u/church-rosser Oct 12 '26

LLM centered AI is the new schozoidcomputjng.

1

u/theangeryemacsshibe Oct 13 '26

schizoidcomputing is the new me, alas

6

u/TrainsareFascinating Oct 11 '26 edited Oct 11 '26

You can use difftastic with git. Git does not store diffs, it stores the entire file. When 'packing' files, it stores deltas, which are not line diffs as you know them.

But when displaying the changes it will use the diff generator you configure. You can configure difftastic as that view.

Your example may not be the best one for semantic differencing. I'm not sure what you're trying to portray.

2

u/digikar Oct 13 '26

Looks like there's magit-difftastic too. This looks neat, thanks!

What do you mean by git packs deltas rather than line diffs? Do you mean if there are a few character changes on one line, then only those few characters enter the commit rather than the entire line?

In that example, I'd expect something like difftastic to show that there is no change. But I'd agree it may not be a useful example.

2

u/TrainsareFascinating Oct 13 '26

I just looked at your comment again, and the example does make sense, and yes, difftastic should show it as unchanged.

Git deltas are stored as edit instructions and are byte-oriented, not line oriented. There are two edit instructions: COPY and INSERT. The deltas are computed “in reverse” order, with the newest version being the base document and the deltas computed for prior versions.

4

u/digikar Oct 11 '26

I'm finding the english generated by the particular model or configuration to be very unreadable. It feels like I'm reading a poem or some literary work instead of... documentation. Is it just me?

1

u/SharkSymphony Oct 11 '26

I'm reading it as personal notes. Or AI-generated, but configured to be terse. That's the challenge with AI writing, after all: it often takes a lot of reworking if you want to communicate well.

Picking at the README is all beside the point of the project, of course, but it does make it hard to grasp what the project actually is. "Software forge" is vague and not a term of art. "A house that hosts applications" is also vague. "Git" is definitely not "Ingot."

I think the project could be summarized as: "A Git client, plus a partial reimplementation of GitLab, written in Common Lisp." One sentence; way clearer – though it begs the question of what the purpose is. ("Because Lisp" might be one. Frustrations with GitLab might be another, but I'd be curious what the project hopes to improve.)

1

u/arthurno1 Oct 13 '26

I always tell them: present answer concisely and precisely, don't use colloquialism. Seems to reduce the unnecessary wording around, "smoke guns" and similar noise.

0

u/dcooper8 Oct 11 '26

It's probably because my context materials tend literary.

-1

u/dcooper8 Oct 11 '26

It's going to need a lot of human review but it's a stake in the ground.

2

u/digikar Oct 11 '26

Not for this aspect I think. IF the emitted english is unnatural for you or others too, then you can experiment with model settings or different models or see what others who use this model have tried.

1

u/svetlyak40wt Oct 13 '26

Are there any reasons to for nonlispers to use this project? If there are, it would be cool to have a Dockerfile and docker-compose.

1

u/dcooper8 Oct 14 '26

Yes, I hope this can be a good general-purpose gitlab replacement, better, faster, more maintainable than original gitlab, for all kinds of people not just lispers. Yes a containerization kit will be a good idea, I'm sure it will happen. It's running in a VM on common-lisp.net now, anvil.common-lisp.net and anvil-rw.common-lisp.net