Skip to content
Vincent Cantin edited this page Nov 28, 2013 · 9 revisions

Semantic diff

Prototype

  • Project setup (using Gradle), and small proof of concept.
  • Define the semantic criteria used to express the differences between 2 contents.
  • Document the non-uniqueness of the description of the differences between the 2 contents and how to handle it.
  • Define the semantic data to extract from the content for each of the semantic criteria.
  • Implement functions to retrieve those data.

Integration within NetBeans

No roadmap for now.

It seems that the current version of NetBeans (7.4) is using ANTLR3, not ANTLR4. Also, after a quick look at the source code of the diff project in the source code of NetBeans, it seems that we will have to rewrite most of this module when we will do the integration. The existing source code can still be useful to help us understand how to be backward compatible and how to integrate with the graphical components. Another solution instead of rewriting the module is to write a different one and presenting it as such .. this will have to be discussed with the maintainers of NetBeans later. Maybe we can find persons willing to help integrate, if they think it is worth the effort.

It would be nice to have the semantic diff/merge working in NetBeans with Git, Mercurial, and maybe SVN (who is still using CVS?).

Semantic merge

No roadmap for now.

A 3-ways merge is the operation of merging changes applied in parallel to a content. A 3-ways semantic merge is a special case of a 3-ways merge where the changes to be merged are described using semantic differences.

Using semantic differences to represent changes on computer program's source code makes most sense during a merge, because if a conflict is detected while merging semantic differences, then it means that the changes are truly incompatible with respect to the field of expertise of the content (because a computer program's source code is all about defining a semantic).

The semantic merge is going to save a lot of time to developers, as a lot of merge conflicts reported using a line-by-line (or file-by-file) comparison are not semantically conflicting.

The conflicts which may arise during a semantic merge will have to be presented in a different way compared to a classical line-by-line diff, because the user will not be asked to choose between a set of lines from a content or another, he will have to choose between the semantics he prefers. Graphically, it means to have at least 3 views on the screen: 1 view showing the result of the merge, and n other views showing the n contents to merge from.

Other experiments to do in NetBeans

Those experiments might be useful to improve the integration of the semantic diff and the semantic merge into NetBeans.

Contextual display

Sequential display of the elements within a class is an inheritance from the past when programs were printed on paper. It doesn't yield any justification nowadays and Vincent considers it hasBeen. Programming is already contextual, so should the display be.

This experiment aims to display only the part of the program which is relevant to the piece of code being written by the developer.

Associated comments

Except the Javadoc comments, comments in Java are not associated to what they comment, and there is no reliable way to automatically extract those associations.

This experiment aims to present the user a UI component which allow him to comment pieces of code or simple java expressions.

Expression-based bookmark

As of NetBeans 7.4, bookmarking is done per line. It would be nice to have it done per selected expression. The bookmark window would need to be adapted as well, as the navigation between bookmarked expressions or lines doesn't have to be sequential (how about an option for sorting the bookmarks by usage frequency or by date of last usage).

Need to add a bookmark group or bookmark set, to use similarly to the project group feature. It would be very useful for people working on multiple issues in parallel on their projects.