12

I know that for many years, C# was proprietary, and it's always been focused on Windows. Then I started hearing about Microsoft releasing component after component of the language's framework as open-source. For many years Wikipedia said that the Common Language Runtime was proprietary, but now it's open source too.

How much of the language is open source now? Are there any necessary proprietary components? Could I bootstrap it given all the code that Microsoft has released? How do Microsoft's patents factor in?

  • 3
    You have to distinguish C# the language (older versions of which have an ECMA standard), and Microsoft's implementation of that language (Visual C#, Roslyn, …), and other implementations like the open-source Mono project (which has worked perfectly fine on Linux for many years). For the Microsoft implementation, you also have to distinguish the status of the runtime versus the multiple available standard libraries (.NET versus .NET Core). So which language version, implementation, and standard library are you asking about? – amon May 14 '17 at 9:06
13
  1. The C# language specification is publicly available, but Copyright of Microsoft.
  2. The Roslyn compiler is licensed under Apache 2.0, so that's open source.

Could I bootstrap it given all the code that Microsoft has released?

Yes. The Roslyn compiler has been written in C# and is able to compile itself.

So, that pretty much covers the language itself. The spec is Microsoft copyright, but the ECMA officiates the spec. Microsoft's compiler implementation for that spec is open source.


Bonus round, because I have a feeling this is what you really want to know. What about the runtime and standard library? Are those open source?

Well, some of it is. Particularly, .NET Core is.

  1. CoreCLR (Common Language Runtime) is licensed under MIT.
  2. So is the standard library, CoreFx.

However, as far as I know, the Windows (desktop/classic) runtime and framework are still closed source. I suspect this is because they're tightly tied to the operating system itself. This also means that Winforms, WPF, & UWP (the desktop UI frameworks) are closed. However, much of the .NET framework is source available.


Über bonus round: There are several other open source Microsoft projects listed under The .NET Foundation.

Oh, and don't forget F#, it's libre too. All in all, Microsoft has done a wonderful job of opening its stack and inviting the community to contribute over the last few years. Despite a few missteps along the way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.