2 ms·
It is deeply stupid that I spend much of my time looking at C++ (and asm, and IR...) diffs in a tool that looks at the raw bytes instead of at the AST they repr
by JonChesterfield 3y ago
It is deeply stupid that I spend much of my time looking at C++ (and asm, and IR...) diffs in a tool that looks at the raw bytes instead of at the AST they represent. Likewise git merge would do a lot less damage to codebases if it spliced the AST instead of the raw bytes.
I'm at some risk of replacing that with something hacked together out of XML. Hopefully you're doing something useful in this space.
- jsunderland323 3y agoTotally. Sadly I’m focused on GUI use cases and not AST. I’m more focused on making distributed version control for tasks that are handled better by visual editors than plain text. Universal AST diffing and merging is probably an impossible problem to solve (entirely). You could write a driver for llvm that would work for any language that shares the same IR state. Even then there’d be a lot of cases where you’d have to depend on a developer to manually resolve syntactic conflicts and enforce consistency in the IR state, which makes it pretty impractical. But two things, first, I would look at Pijul, my understanding is there is (some) support for AST diffing and merging. Second, git does support custom merge and diff drivers — I’m not sure if this is where you’re going with your xml hack but I don’t think it’s too cumbersome to write a custom differ if your painful conflicts are relatively constrained to certain functionality or part of your code base. My site is half built (lots of broken links and only half of the documentation is done so please don’t judge me), but I think my technical explanation does an okay job of talking through some of the complexities to think through in regards to structured diffing and merging. It might be helpful to you if you do decide to write a git merge driver. https://floro.io/technical-overview-part-1 https://floro.io/technical-overview-part-1