Ydiff: Structural Comparison of Programs
yinwang0.wordpress.com
Ydiff: Structural Comparison of Programs
1–10 of 35 posts
Re: Ydiff: Structural Comparison of Programs
#2Re: Ydiff: Structural Comparison of Programs
#3The one interesting addition my project had was merging. The neat trick was that we reused the same tree diff algorithm to find conflicts :P. With a bit of work, we would have some very neat features, including the ability to resolve certain conflicts which physically overlap.
[1]: http://jelv.is/cow
Re: Ydiff: Structural Comparison of Programs
#4Re: Ydiff: Structural Comparison of Programs
#5Re: Ydiff: Structural Comparison of Programs
#6Neat, love new approaches to old problems. At first sight I thought it would be an awesome implementation of an idea I had (and probably tons of other people before and after :) a few years ago to find cheating among C programming assignments: convert programs to PostScript "drawings": ifs, fors and certain other functions gave rise to different "movements" of the cursor, eventually drawing paths for different expres…
Re: Ydiff: Structural Comparison of Programs
#7Related to this, I wish there was a way to navigate a programme based on a tree, not just line and character navigation.
Re: Ydiff: Structural Comparison of Programs
#8Really neat. Shall have to play with it. Related to this, I wish there was a way to navigate a programme based on a tree, not just line and character navigation.
Re: Ydiff: Structural Comparison of Programs
#91) Your C++ example, we have "namespace 'v8'" -- which has been removed and reinserted. That made me scratch my head a bit. Has it been refactored enough that this is kind of a rewrite? If so, there might be a third or fourth color here for "hey, this part didn't /change/ per se, but everything under it did"
2) Your Python example: right at the top we have a new class, PairIterator, with "class" rightly green. However I'm fighting against years of reading textual diffs that suggest the whole block is really the new thing. Could the block highlight the class as-is (where it changed) and subtly color the rest of the tree (what else changed with it)?
3) I get your whole in-the-future-we-store-ASTs argument, but that's certainly not the case today. Today we store text, and I don't see that changing. Could there also be a diff, perhaps even another mode that, counter to just dealing with structure, deals with formatting? ie, find the ranges that contribute nothing to the AST and then diff those textually.
I like the ideas and the paradigm shifting -- and the real answer is likely somewhere in between, because, at the end of the day, programmers are still editing things in text, even if they are manipulating greater structures.
As a diff tool, I'd introduce this to my workflow in a heartbeat if I wasn't working so hard to interpret what the diff means.
Re: Ydiff: Structural Comparison of Programs
#10Neat, love new approaches to old problems. At first sight I thought it would be an awesome implementation of an idea I had (and probably tons of other people before and after :) a few years ago to find cheating among C programming assignments: convert programs to PostScript "drawings": ifs, fors and certain other functions gave rise to different "movements" of the cursor, eventually drawing paths for different expres…
Am I correct in guessing, though, that it would only work for relatively sophisticated assignments that can be done in lots of different ways? Or is there always enough variety in different people's structure to tell when things are being copied?
Basically it was a fun project that got me a little into Lex, the kind of odd stuff I do in Saturday afternoons