

Announcing the new Roslyn-powered .NET Framework Reference Source - daigoba66
http://www.hanselman.com/blog/AnnouncingTheNewRoslynpoweredNETFrameworkReferenceSource.aspx

======
d0
I know this is getting a lot of fanfare but let us apply four major costly
problems I'm having with the CLR/Framework at the moment:

1\. Microsoft.Build.Tasks (the bit that has been screwing with me all day)
contains static sealed classes with nothing in them. I thought this was a
reference source rather than a source of empty interfaces and empty
implementations? Still having to resort to reflector to find out what is going
on. Problem not solved.

2\. So, ReaderWriterLockSlim has a bug in it with respect to low CPU
allocation in virtual machines where 20 concurrent threads accessing a locked
object at the point of write cause the spin lock in the implementation to
thrash and up blows a race condition taking out the process. I can actually
see where the bug is now. Where do I submit this bug, bear in mind I can
actually recreate it? I phoned up our MSDN rep - they said raise it on
Connect. There isn't a place for it on Connect. Phone up generic paid support,
three levels of technical staff bounce me around for a week. as a PAID UP GOLD
PARTNER, this sucks. If you open your source, track bugs openly too. Problem
not solved.

3\. This is only the core framework. We really need the entire lot including
all dependencies and external tools. There aren't any symbols on symbol server
or this for VSTO or Sharepoint for example? What we do get is another black
box somewhere in the system that we can't inspect or poke inside even though
it's a wrapper for a COM API or a product API. Problem not solved.

4\. Does Rosyln/next MSBuild support parallel compilation? Being tied to a
single compilation core on a VS2013 build means we have 8 core Xeons sitting
there doing nothing. Our only hope of speeding this up is cranking up to high
end i7 to get one core with crazy integer performance. 20 minute sit down
compiles are too much these days. [http://xkcd.com/303/](http://xkcd.com/303/)

I understand this is progress and Roslyn is cool and all that, but what does
it deliver for every day users of the CLR/Framework? It doesn't really make
our day much easier. In fact stuff that really improves developers' lives has
stopped appearing completely and instead we get tedious reengineering projects
and new features designed only to lock us further into the system (VS
online+sign in anyone?)

Also how does this compare to say LLVM/Clang?

I imagine this semantic compilation stuff will make some static analysis stuff
easier and stamp on the toes of Coverity etc but that's about it.

Edit: sorry if this is purely a content-free rant and unpopular but after 12
years of this crap from Microsoft, I want to see new wheels, not the same ones
reinvented and remarketed. Developers are lapping up this crap constantly as
if it's as good as it gets. We need some REAL CHANGE towards openness and
consistency and to ask the community and users what they want rather than
telling us what we need.

~~~
keithwarren
So you have found some esoteric issues that are likely encountered by less
than .01% of developers and this is somehow 12 years of crap from Microsoft?

I find it funny (not really) that somehow this floats up as the top comment
when most developers have no clue what he is talking about but since this is
HN and someone is saying how bad Microsoft is then lets upvote. Microsoft
killed my pappy and all (ht to shanselman) so I must do everything I can to
make sure no one else dares like them.

~~~
bad_user
So, instead of addressing his points, you instead chose to make fun of it,
criticize HN and invoke a marketing piece to somehow prove your stance on the
matter. Nice going.

Note that I find Roslyn an interesting project and it's always a WTF for me
whenever I touch .NET that I'm not able to easily view/step through the source
code of everything I use, including the standard library, so for those
suffering, this article is actually good news - and I'm fed up with negative
and uninformed opinions on anything interesting, especially on my current
platform of choice that's very trendy to bash lately, which I won't name
because it would defeat the purpose - because it's much easier to provide
uninformed, non-constructive criticism then it is to build stuff, plus we tend
to treat our favorites as sports teams with us behaving like cheerleaders, am
I right or what?

But for the uninformed reader, such as myself, comments such as yours just add
to the noise, I mean WTF?

~~~
keithwarren
NEWSFLASH: Stepping through the framework sources has been available for
several years. Roslyn, which is a re-architecting of the compiler itself is
not somehow going to change this or make it better.

~~~
bad_user
Oh, so can I open the project in the IDE, click on any identifier and have the
source-code of the library in question automatically downloaded, after which
the IDE would navigate to the right file and line? I also expect it to work
while debugging, no matter the library I'm using, including the standard
library, so does it work?

Because that's what I expect from a "modern" developer's environment in year
2014.

------
_random_
Roslyn changes are starting to kick in - 2014/15 should be pretty exciting!

"This means that folks like the Mono team could look at this Reference Source
and not have to gouge their eyes out afterwards. "

Very reassuring as well.

~~~
MichaelGG
The reference source license doesn't allow any use but reference. Does that
help Mono? Wouldn't the possible pollution still mean someone that's seen the
source can't contribute to Mono? (I had the private shared source access in
2004; AFAIK Mono would still ban me from contributing.)

------
rossy
It looks like there are still big censored parts: [http://referencesource-
beta.microsoft.com/#PresentationFrame...](http://referencesource-
beta.microsoft.com/#PresentationFramework/src/Framework/System/Windows/Window.cs#461)

One of the first things I had to do for my last job was subclass Window to
support custom borders (Zune Player/VS2012/Office 2013 style.) I took a peek
at the reference source, and I couldn't help but think the missing bits were
the juicy bits, workarounds for window manager bugs or insights into how it
does things.

~~~
shanselman
No, we're NOT intentionally censoring anything. This looks like a bug in the
source processing. We'll take a look.

If you see a munged file, report it with the feedback link. Sometimes regex's
go bad and we can fix them.

~~~
rossy
That's good to hear! I only guessed the missing parts were censored because a
lot of them came after comments that implied the following code was security
critical, like here: [http://referencesource-
beta.microsoft.com/#PresentationFrame...](http://referencesource-
beta.microsoft.com/#PresentationFramework/src/Framework/System/Windows/Window.cs#2313)

I apologise if this isn't the case, and I'll definitely use the feedback link
if this issue comes up again.

------
Touche
Can anyone explain the benefits of a "compiler as a service"?

~~~
sytelus
Here's very cool example of what compiler as service can do: let's say you
want extend SQL so that you can write C# expressions in SELECT like this:

    
    
      SELECT MyClass1.Method1(ColumnA, Math.Round(ColumnB))
      FROM Table1
    

Another example is you can extend your scripting language so that user can use
full power of Linq.

So in otherwords, you can extend any of your little languages so that you can
mix C# in it. Considering C# supports tons of functional features, Linq,
anonymous types, dynamic types etc this can really beef up host language.

~~~
noblethrasher
I thought that Roslyn expressly did not support extending the language.

~~~
taspeotis
My understanding is that you use Roslyn to use C# anywhere. It can parse
expressions and compile and execute them.

E.g. If you're writing a BASIC interpreter:

    
    
        10 PRINT "Hello World"
        20 CSHARP "Console.WriteLine(42);"
        30 GOTO 10
    

You call Roslyn on line 2 with the expression to parse and execute.

------
codeulike
Roslyn sounds pretty cool. For the record, did Microsoft originate the
'compiler as service' idea or did it originate somewhere else?

~~~
keithwarren
Mono has had compiler as a service for quite some time now

~~~
xanadohnt
They had the implementation, yes. But the idea predates Mono's implementation.
I can't find any references offhand but I do believe Roslyn inspired the Mono
team. Roslyn has been in development for a very long time.

~~~
amaks
Roslyn was announced several months after Mono has created their compiler as a
service implementation. Having said that, clang/llvm was out there for some
time already. So yes, the idea predates Mono for quite some time:-)

------
nawitus
I wonder why they don't just publish the source repository on the web.

~~~
breischl
My hunch is that they use some internal server and don't want to expose it to
the world. They could copy it somewhere, but if you're not going to take
contributions then why bother?

Also, their code explorer is far and away better than trying to spelunk
through a Git repository looking for that one file you want to read. So I
think it's actually an improvement for when you just want to look at a few
files rather than download everything.

~~~
nawitus
>My hunch is that they use some internal server and don't want to expose it to
the world. They could copy it somewhere, but if you're not going to take
contributions then why bother?

Ah. They should want to expose it to the world and take contributions.

