Microsoft: Open source and cross-platform all the things

Published on November 12, 2014

It was announced today that Microsoft will be delivering a cross-platform and open source, cloud-optimized version of the .Net framework.

AllTheThings

Today’s announcement is a culmination of a series of changes that have been happening over the past few years in certain parts of Microsoft.  Through the persistence of numerous Microsoft employees and the encouragement by the .net developer community, OSS is finally becoming accepted as an integral part of Microsoft’s business model

Wait, there’s more…

Surprisingly, releasing the source code to this new .net Framework is probably the least significant part of the announcement.  For as long as I remember, Microsoft have had a culture of creating strong coupling between Microsoft’s own products.   This is epitomized in the developer world by the fact that it is very difficult to get build machines to function without have Visual Studio on them.  This is just one example, but this has been a pervasive attitude throughout the company.

Time to leave the nest

In my opinion, today’s announcement is a declaration that Microsoft have grown up.  They have accepted the fact that their products must succeed on their own merit, and not because a customer chose one product and became locked into an entire eco-system.

.net on every server

The new cloud-optimized .net runtime will run on Mac’s and on Linux.  You can use your favorite code editor to write and compile .net applications.  There is no more coupling with Visual Studio.  In fact, in the last few days, I have experienced first hand that MS employees are working hard to get features like, intellisense, syntax/error highlighting features into editors like Sublime, Atom, Emacs and vim. With the announcement of Visual Studio Community edition, which is almost on feature parity with the Pro edition, the old Microsoft would just have said, “hey, we’re giving you a free edition, why would you want to use anything else”.

Haven’t we heard this all before?

Microsoft have made “open” announcements before and have had less than stellar results.  I think one of the reasons has been that it has taken a very long time to chip away at the internal cultural armor within Microsoft.  At the MVP Summit we had the opportunity to watch a panel discussion with some senior Microsoft people who were clearly 100% behind this open approach.

Best of breed should always win

One indication that this shift in culture is more than skin deep is the fact that Microsoft teams, more and more, are choosing to use external tools instead of being required to use their own.  The new Cloud-Optimized CLR and ASP.NET vNext are all being developed in Github repositories.  To file an issue, you can create a Github issue and if you think you can fix a bug, then send a pull request.  Github is the king of “social-coding” which suits an OSS model well.  Microsoft’s own TFS source code control has always been aimed at the enterprise space which often has different needs.  Microsoft’s teams get to use the best product for their own particular requirements and Microsoft products need to compete purely on merit.

Oh, no, not another .net framework!

I must admit, when I first heard about the cloud-optimized runtime, I was underwhelmed.  Why do we need yet another variant of the .net framework?  Why is it server-optimized?  What about mobile and desktop?  Well, technically, the CLR for this stack is not new.  It’s the Silverlight CoreCLR.  I’ll wait for you to stop snickering…. It is also the CLR used to power .net applications on Windows Phone 8 and Windows 8 apps. The CoreCLR is a proven, lightweight version of the CLR that happens to be ideal for creating lightweight web applications. When this lightweight CLR is combined with the new K Runtime Environment, the result is compelling.  Different versions of the CLR can sit side by side and switching between them is trivial.  The .Net framework libraries have been sliced up into more then 70 nuget packages so that only the functionality that is needed is pulled in. 

A victim of success

One of the major challenges with the .net framework in the past is that it had become very large to deploy, very slow for the team to get new features into the framework and every new major version, the team has attempted a new, hopefully less painful way, to deliver those changes.  The result has been inconsistent and confusing.  The KRE does enough things differently that we may finally have something that can allow the ,net framework to evolve quickly and painlessly.

K for Kool

The KRE finally breaks the dependency on the Global Assembly Cache that has been a critical part of .Net since it’s inception.  However, as the .net framework team like to say, they are “in the app compat business”.  There will still be full CLR framework support, that still uses the GAC for applications that run under the K runtime.  The new CoreCLR also changes the rules with regards to strong naming.  Microsoft are now saying quite openly that they do not recommend strong naming for Open Source projects, which will come as a great relief for many developers.

This is just the beginning

It was not until I realized the impact that open-sourcing big chunks of the .Net CLR would have on the Mono framework, that I started to appreciate the bigger picture.  The plan for the future, as I understand it, is that Mono will start to replace some of the less optimized parts of Mono with MS source code.  Future versions of Mono will take advantage of more pieces of the CLR infrastructure.  I can envision a future where some combination of Mono / CoreCLR would become a “client optimized” CLR stack.  This would bring a fully supported and optimized .net to every platform that matters.

How is this going to help us developers?

Now that pieces of the .net frameworks and Core CLR are easily accessible on Github, it should really help developers get a better understand of how the .Net framework behaves and by being able to see the commit history and related issues we should start to get a picture of why it behaves that way.

The .Net and Core CLR source code is MIT licensed which now allows us to copy and modify the code.  This is huge.  There is all sorts of useful code in the framework that is marked as internal because MS didn’t want to support in the public interface.  We can now re-use this code.  Microsoft have also attached their Patent Promise to the repositories.

Cross platform is becoming a critical part of the Microsoft developer’s workload.  With easy access to Linux VMs on the server side on Azure and tools like Xamarin that allow C# across iOS and Android, Microsoft developers can reach every platform.  Having Microsoft recognize cross platform as a 1st class concern, rather than just a feature checkbox, is going to make building products with wide reach much easier.

This is a rebirth of Microsoft and I look forward to being part of it.