Early adopters for SemanticMerge -Mac version Wednesday, February 19, 2014 Pablo Santos semanticmerge 0 Comments

Finally, we’re ready to ship a Xamarin Studio powered SemanticMerge release running on Mac. You can sign up to get one here. We’re looking for the feedback of early adopters!

In the picture you can see the “visual merge” rendering a “Listen()” method being moved to two different classes in parallel:

Moved to class “ClientSocket” on the left – where left means “theirs”

Moved to the class “DNS” on the right – where right means “yours”

Modified on both (icon “c” stands for “changed” and “m” for “moved”)

This is the type of conflict that will break down in tears any other merge tool, but not Semantic :-)

Merge magic for C# and Java developers on Mac

SemanticMerge is a “language aware merge tool” which means it needs to understand the language to calculate the merge. So it is programming language dependent which in turn means that we have to develop support for new languages one by one because we need to parse each file and handle the language particular constructs.

So far we’ve released support for C#, Vb.net and Java, but this release also includes support for C language. In fact you can see all the examples once you start up the tool:

Obviously to really rock on Mac we’ll need Objective-C support (vote for it if you are interested) but this release is really focused on the growing community of developers using Xamarin who write C# code on the Mac on a daily basis. We love the idea of C# running everywhere and SemanticMerge for Mac is meant to contribute on that goal.

By the way there are also many developers coding in Java on Mac who will also benefit from this new release.

C support

Yes, C support (another frequent UserVoice request) is included in this release.

We’ve done quite an amount of work to make this happen since C is by far more complex to deal with than the other languages we supported so far.

We use libclang to parse the code (the same libraries we’ll use to implement C++ support) and create the intermediate trees that we use to merge. So initially parsing is not a big deal since libclang takes care of it. The problems come from the nature of C itself:

More often than not you face ambiguous situations where the parser needs the header files to figure out how to deal with a define or macro.

Including the headers is not a big deal for a compiler, but Semantic needs to be as standalone as possible (and as easy to configure as possible) so ideally you don’t have to define where the headers files are in order to process the merge of a file. While certainly doable it would complicate the setup of the tool (per project basis).

So we’ve implemented some logic (I’ll be blogging about it in more detail in a future blog post) to try to avoid these external dependencies as much as possible although we’ve also added ways to define commonly used symbols (like macros and so on) to solve situations where the parser can’t proceed alone.

We used the Linux source code to benchmark (among many others, since we total a couple of millions C file for testing) and this approach is able to deal with 99.32% of the declarations. As I said, I’ll be adding more info in an upcoming post :-)

UserVoice

The Mac version has been the number one request in our UserVoice for months and it is finally closed :-) Of course this is just an initial release and we’ll continue working to come up with new features, create the standalone diff tool (now only the merge tool is available) and many more.

Powered by Xamarin Studio

C# is our language of choice and hence using Xamarin to create a new native GUI on Mac has been a key factor. We use other languages on a daily basis (especially to develop Plastic SCM) but C# is where we feel more comfortable.

We had to get up to speed with Mac development, the Cocoa underlying libraries, new concepts, the entire layout definition language and many more, but everything was greatly simplified by Xamarin. At the end of the days you have the same tools, the same language and concepts. Coming from a mostly Windows background in GUIs, you find yourself in a new world but helped by known tools.

Want to join?

The Mac version is still work in progress. While it uses the same core as the Windows and Linux versions, we’ll need to improve its usability with special detail to the Mac way of doing things.

If you want to join and help us creating the smartest possible merge tool, please sign up here.

Edit: for more info take a look at the SemanticMerge blog here.