cat posts/2014-11-18-net-goes-open-source.md

.NET goes open source, and I did not expect to see it

· 4 min read · dotnet microsoft open-source

I’ve been in the .NET world since the 1.0 betas and an MVP for C# and .NET since 2005, and I genuinely did not think I would see this. At its Connect() event last Wednesday, Microsoft announced that it’s open-sourcing .NET Core under the MIT license, with a patent promise, hosted on GitHub, and that it’s going to run on Linux and Mac OS X officially, with Microsoft doing the work.

I want to be careful not to oversell it, because the internet spent last week doing that for me. What actually shipped on the day is a start, not the whole thing. The code up on GitHub is some of the core libraries (corefx), and it only built on Windows at first. The runtime itself (the CLR) and the cross-platform bits are promised, not delivered. The MIT license and the patent grant are the real news; the Linux and Mac story is a roadmap. So nobody’s running their ASP.NET app on Linux next week.

But the direction is unmistakable, and for me it’s hard to overstate how strange it is to type that. For most of my career the posture was closed: the platform was a product, the source was a trade secret, and if you wanted to know what a framework method actually did you either used Reflector (which decompiled the assemblies, and which Microsoft was not thrilled about) or you guessed. They put reference source online a few years back, but it was look-don’t-touch, under a license that let you read it for debugging and nothing else. This is a different thing.

Some of this has been building for a while if you were watching. ASP.NET MVC went open source years ago. Then there was Roslyn, the rewrite of the C# and VB compilers as libraries you can call, which went open source earlier this year, and which is the sort of thing you only do if you’ve genuinely changed your mind about openness, because a compiler is about as close to the crown jewels as it gets. The .NET Foundation got set up to house all this. So the trajectory was there. Connect() was the moment it stopped being “Microsoft dabbling in open source around the edges” and became “the platform itself is open”.

Why now? My read, and I’m guessing like everyone else, is that it’s about relevance. The interesting server-side action for the last several years has been on Linux, in languages and runtimes that are free and open and that a startup can adopt without talking to a salesperson. I’ve built on plenty of them. A new company spinning up today reaches for Node or Rails or Python and some Linux boxes, and .NET wasn’t even in the conversation, not because it’s bad (the CLR is a genuinely good runtime and C# is a very good language) but because “Windows Server licenses” is a sentence that ends a lot of conversations early. If you can’t get the next generation of developers to try your platform, it doesn’t matter how good it is, and you can’t get them to try it if step one is buying Windows. Open-sourcing it and putting it on Linux is how you get back into the conversation. Satya Nadella has been in the top job less than a year, and this has his fingerprints on it; it’s hard to picture the previous regime signing off on it.

What I don’t know yet is how real the cross-platform story will be in practice. “Runs on Linux” can mean a lot of things, from “we recompiled it and it technically executes” to “this is a first-class, well-supported, idiomatic way to deploy”. Mono has existed for over a decade precisely because there was no official open .NET on Linux, and it’s a heroic project that was always playing catch-up against a moving target it couldn’t see the source of. Now the target is visible. Whether Microsoft and the Mono folks pull in the same direction or trip over each other is going to matter a lot. And there’s a mountain of real-world .NET, mine included, that’s tangled up with Windows-only pieces (the full framework, IIS, Windows-specific APIs) that aren’t going cross-platform any time soon. .NET Core is a new, slimmer thing, not the old one ported.

I’m also a little wary, out of long habit. “Embrace” has a track record. But the MIT license is not a thing you can un-ship. Once this code is out under MIT with a patent grant, a fork is always possible, and that changes the relationship whatever Microsoft’s intentions are. I don’t have to trust the promise, I can read the license.

So I’m cautiously, genuinely happy about it. I’ll believe the Linux story when I’m running something real on it, and I’d put that a year or more out given what actually shipped versus what was announced. But the thing I’d have bet against for a decade just happened, and I was wrong about it, which is a nice change from being right about Microsoft staying closed. I’m going to go read the corefx source this weekend, mostly because after all these years I still can, and I want to see what’s actually in there.