Live data from Hacker News

Microsoft Open Sources C# Compiler

roslyn.codeplex.com

121–130 of 459 posts

Re: Microsoft Open Sources C# Compiler

#121

They also announced as part of this that they are putting a large swatch of their .NET Source code under Apache 2 and accepting pull requests. Folks, this is a very big deal for Microsoft. Who would have imagined this 10 years ago? Here is an image that shows what they are putting into the community https://pbs.twimg.com/media/BkT9oBcCQAAHIAV.jpg:large

signs of the new Satya Nadella era?

Re: Microsoft Open Sources C# Compiler

#122
post #75

Earlier quoted context omitted.

Is Mono able to compile Roslyn?

I assume you mean the Mono C# compiler (the one that the Mono team develops). Interestingly, no -- but neither can the native C# compiler (that's what we call the old C# compiler that everyone's using in VS right now)! Why? The C# compiler is bootstrapped, so we actually compile the compiler with the compiler. It just so happens that a while ago we felt we needed a feature so badly for the C# compiler that we introdu…

[deleted]

Re: Microsoft Open Sources C# Compiler

#123
post #83

Earlier quoted context omitted.

Once again the whole KILL MONO FUD was the actions of the Open Source Community in the last 5 years. I never understood how in the world they got this is a trap from everything that was happening. I don't agree with RMS many times but in this one way he was 100% wrong when he targeted mono.

You honestly don't get it? I really like microsoft products and I use them every day, however the business model is too lock people in to their ecosystem so that you have to purchase licenses for their products. Mono clearly undermines that b/c it allows you to "easily" jump ship to a free platform. Unless I'm somehow completely misunderstanding their business model - killing Mono just makes business sense.

The KILL MONO FUD was coming from the Open Source community not from MS.

Re: Microsoft Open Sources C# Compiler

#124
post #83

Earlier quoted context omitted.

Once again the whole KILL MONO FUD was the actions of the Open Source Community in the last 5 years. I never understood how in the world they got this is a trap from everything that was happening. I don't agree with RMS many times but in this one way he was 100% wrong when he targeted mono.

You honestly don't get it? I really like microsoft products and I use them every day, however the business model is too lock people in to their ecosystem so that you have to purchase licenses for their products. Mono clearly undermines that b/c it allows you to "easily" jump ship to a free platform. Unless I'm somehow completely misunderstanding their business model - killing Mono just makes business sense.

I think you misunderstood the parent. They are talking about the open source community and RMS, not Microsoft trying to kill Mono.

Re: Microsoft Open Sources C# Compiler

#125
post #83

Earlier quoted context omitted.

Once again the whole KILL MONO FUD was the actions of the Open Source Community in the last 5 years. I never understood how in the world they got this is a trap from everything that was happening. I don't agree with RMS many times but in this one way he was 100% wrong when he targeted mono.

You honestly don't get it? I really like microsoft products and I use them every day, however the business model is too lock people in to their ecosystem so that you have to purchase licenses for their products. Mono clearly undermines that b/c it allows you to "easily" jump ship to a free platform. Unless I'm somehow completely misunderstanding their business model - killing Mono just makes business sense.

Red Hat, for instance, makes a ton of money off the reverse model, where they let CentOS give away their core offering for free (heck, they're even paying people to work on CentOS now), and they make their money off clients who have money and are willing to exchange it for support and such for otherwise free offerings. There's really no reason Microsoft can't do something similar here (and they seem to be trending in that direction, although not quite to the extent Red Hat has) -- a mix of free-as-in-beer and open source tools for a "core" offering, so people can get into the Microsoft developer ecosystem, and a variety of paid offerings on top of that as their needs grow. And the extent of Microsoft's partnership with Xamarin shows just how much Microsoft is depending on Mono for their strategy, it'd be senseless at best to kill it.

Re: Microsoft Open Sources C# Compiler

#126
post #81

Earlier quoted context omitted.

The C# compiler is written in C#, so you can use it anywhere with a .NET runtime. Microsoft doesn't ship a .NET runtime for Linux, so you'll have to use Mono, but if your app is compatible with Mono, you're good to go!

How does something like this happen? How can you write a compiler in the language that it is supposed to be compiling?

Funny you should mention that! There was a really cool article about bootstrapping a compiler nearly from scratch just the other day[1]. But yeah, most people just start with C or C++ until they can compile enough of the language to write a compiler in it.

Some other interesting contemporary examples:

I think as we speak Go is working on its plan to switch from using a compiler written in Go[2].

Rust[3] has kind of a hybrid approach where the front-end of the compiler is written in rust, but generates llvm bytecode which is then compiled the rest of the way by llvm itself. It takes three "stages" for them to do a full compile, first a binary "snapshot" compiler is downloaded and used to compile the compiler (stage 0), then that generated compiler is used to compile the compiler again (stage 1), and then that generated compiler is used to compile the compiler again (stage 2). Stage 2 is actually just a test - its output should be identical to that of stage 1, and if it isn't, something went wrong.

There is a classic lecture from Ken Thompson[4] that I think is really illuminating on how this stuff works, if you're unfamiliar with it.

It's really fascinating stuff!

[1]: http://homepage.ntlworld.com/edmund.grimley-evans/bcompiler.... [2]: https://docs.google.com/document/d/1P3BLR31VA8cvLJLfMibSuTdw... [3]: http://www.rust-lang.org/ [4]: http://cm.bell-labs.com/who/ken/trust.html

Re: Microsoft Open Sources C# Compiler

#127

Earlier quoted context omitted.

I'm not sure whether there ever was a time when .NET devs had to seriously consider "what was happening in the background". .NET Framework documentation has always been pretty good. Not too many dark corners there.

Not a .NET dev myself, but I believe Android's documentation is also pretty good. Nevertheless, I can distinctly recall instances when looking at Android's source was necessary/helpful.

Having done a lot of C# and Java (both of which are very well documented) in the past and a little bit of Android development recently, I cannot confirm that. The documentation is a horrible mess of a few helpful things (most longer texts introducing platform quirks and intricacies are useful), barely documented things (many, many parts of the class libraries) and downright undocumented things (styles, where the "documentation" even tells you to read the source). (Not to mention the plethora of typos and misspellings in the official docs.)

Generally I've not been very impressed with the quality of Android's documentation and firmly believe a company such as Google can do better. And after having a look at the process around getting a patch approved I deemed it not worth my time trying to contribute documentation fixes and enhancements.

Re: Microsoft Open Sources C# Compiler

#128

Everyone on Roslyn is really excited about this and we hope that it serves as a signal that big things are happening in .NET to make the entire platform more open and agile! P.S. We're the Visual Basic compiler too :)

What's the likelihood the .NET VM is open sourced as well? I use Mono right now to run my apps on Linux but it would be great to use the official implementation since Mono has subtle differences.

Even if they were to do that, I doubt that it's portable cross platform code. Someone will need to port it, and it's hard to know how the effort required compares with the effort required to optimize the Mono runtime to be as good as the MS one running on Windows...

Re: Microsoft Open Sources C# Compiler

#129

If Microsoft starts working on its own Unity-clone, with a functional language, advanced concurrency features, and good incremental GC, they could be sure to capture a big chunk of the mindshare of game developers. This could then be parlayed into mindshare of soft-realtime development, which will become ever more important.

Integrate all the good parts from VS to the "Unity-clone" and top it with nice indie-license. Bake modularity into so that you can build the game with feature-toggles and control the flags from the server. Ship the game to testers and enable one flag at a time to see when things crash (no need to wait x0min for the new build to finish). Make testing easier and integrate it with some build engine (jenkins, TFS), enable REST api so you can get all the game element information through it. Those features would make the life, of an test automation engineer, a walk in the park :)

Re: Microsoft Open Sources C# Compiler

#130
post #30
post #15

Earlier quoted context omitted.

Who would have imagined it five months ago?

yulaow, clearly the lead-time on a lot of this stuff is longer than Ballmer's been gone, so yeah, not fair to put all this on his departure. "Five months" was a pithy play off "five years," nothing more or less than that.

Does it really take that long to make a decision to open source something? Perhaps for a large company it does, I dunno. The projects themselves may have been in development for a long time (this is definitely true of Roslyn), but that doesn't mean they were always going to be open sourced.
Post reply on HN