
.NET JIT and CLR – Joined at the Hip - benaadams
http://mattwarren.org/2018/07/05/.NET-JIT-and-CLR-Joined-at-the-Hip/
======
Rapzid
These blog posts on deep dives into the .Net internals is one of my favorite
side effects of it being open sourced.

I also enjoy the internal blog posts from teams such as Edge at MS.

It is a great time for software to be sure.

~~~
nightski
It's great for sure but there were deep dive books much more comprehensive
than this on the clr and jit that I read a decade ago. Microsoft press has
always had great technical resources. I actually really miss the days of
technical books. Blog posts serve a purpose but they definitely never
adequately replaced books.

~~~
matthewwarren
> It's great for sure but there were deep dive books much more comprehensive
> than this on the clr and jit that I read a decade ago.

Out of interest, which books are you referring to? I'm always on the lookout
for more (decent) technical books to read! :-)

------
kernoble
These are great!

I'm impressed with the testing approach.

Is anyone aware of similar articles/explanations of the JVM runtime and JIT?

~~~
matthewwarren
> I'm impressed with the testing approach.

Likewise, I really liked the SuperPMI tool, it's a very interesting way of
testing

> Is anyone aware of similar articles/explanations of the JVM runtime and JIT?

I've recently come across this article about the JVM that discusses internals,
[http://blog.jamesdbloom.com/JVMInternals.html](http://blog.jamesdbloom.com/JVMInternals.html)

Also the slides from this presentation a very good
[https://jpoint.ru/en/talks/5vqeeeo89yk6q8qmm0y8sg/](https://jpoint.ru/en/talks/5vqeeeo89yk6q8qmm0y8sg/)

------
epx
.NET, Java, etc. all sound so 1990-ish.

~~~
matthewwarren
> .NET, Java, etc. all sound so 1990-ish.

.NET 1.0 was released in 2002 ;-)

[https://en.wikipedia.org/wiki/.NET_Framework_version_history...](https://en.wikipedia.org/wiki/.NET_Framework_version_history#.NET_Framework_1.0)

~~~
epx
It already felt 1990ish back then, a "me too" moment because of Java. At least
it was not tied to a PL but they couldn't refrain from inventing yet another
one anyway.

~~~
hermitdev
It wasn't a "me too", it was a "we can do better", and IMHO, they did.

C# as a language is very nice to use. 1.0 was lacking a few crucial features,
such as generics (while using 1.1, I was using a code generator to create
strongly-typed collections). It sort of felt like Python at the time -
Batteries included. Even at 1.0, the standard library was quite extensive. By
2.0, generics were there, and that ameliorated my biggest complain with the
language. Every iteration since has been a boon to developer productivity.

Some features, such as Linq are hit & miss for me. On one side, Linq is great
in that it allows one to succinctly express complicated logic. On the other
hand, it also hides a lot of complexity and it can be hard to determine the
algorithmic complexity of even the simplest Linq statement, unless you closely
examine all of the types involved.

Also, not to be forgotten is the tooling. From day 1, tooling for .Net (C# in
particular) was top notch, and it's only gotten better over the years. IDE
support was great (except lacking edit & continue) - Intellisense was fast and
worked incredibly great (and fast), with the built-in support for XML
documentation, its was also helpful & informative. Compared to the
Intellisense support for C++, which was so bad I've sworn off VS for C++ work
(last time I tried was VS 2005, when it'd either hang or crash often) and rely
upon command-line Vim instead.

I don't do much C# currently, but I still love the language. I'm probably
about 1% C# and the rest C++ currently.

Edit: I'm aware that C# was largely born after MS's ill-fated embrace of Java
(J#, IIRC) and the suit from Sun. I see C# as an embrace what worked, kill
what didn't. Java still has some large annoying works (Exception specs), and
C# said: we don't want that.Even C++ realized that exception specs sucked and
ditched them in 2011, but Java's still clinging to them. Also: objects vs
value types.

~~~
ramensea
I have been using C# a lot recently. I can't stand it. It feels like it it
lacks a coherent design. I'm not a huge Java fan either, but at least it feels
coherent to me. I have used a lot of different programming languages and can
see the values in their different approaches, but I have a hard time seeing it
in C#. Also C#'s tooling is only good on Windows.

~~~
keithnz
what don't you find coherent about the desgin of C#? On HN there is far more
value in being specific about your particular concerns rather than giving no
reasons. There is a lot stuff written on the design of C#.

~~~
pjmlp
Some examples from an old timer.

Currently it has three different ways of using event handlers.

The original way, anonymous delegates and lambdas.

The semantics of for loop which were fixed around C# 6.0, need to hunt down
release notes for this one.

Something like .NET Native and .NET Core should have been there on v1.0
instead of tying the runtime to the OS.

~~~
manigandham
Those are 3 options, and have different nuance. They also were added to the
language in later versions but you can use what you what works, I find it hard
to see how that makes the language incoherent as if multiple options are bad.

What exactly changed with a for loop?

The runtime is different from the c# programming language. Originally when
this all started, Windows was the focus and Linux/open-source were not an
option, so saying it should be there from v1 doesn't fit when there was only
one OS that it was planned to run on.

~~~
pjmlp
Multiple designs for the same feature makes a language harder to understand
for beginners, only understandable by those that grew up with language.

I got it wrong, it was _foreach_ , not _for_.

The semantics for the variable were wrong when given into a closure, it was a
breaking change in C# 5.0 to fix it.

[https://www.jetbrains.com/help/resharper/AccessToForEachVari...](https://www.jetbrains.com/help/resharper/AccessToForEachVariableInClosure.html)

[https://stackoverflow.com/questions/12112881/has-foreachs-
us...](https://stackoverflow.com/questions/12112881/has-foreachs-use-of-
variables-been-changed-in-c-sharp-5)

Thing is, there isn't just one version of Windows, and updating the CLR in
place can be lots of fun, to the point many enterprise postpone it ad
infinitum.

This was the original driving idea for .NET Core, when ASP team started doing
it, making it easy to allow IT to update Windows production servers to newer
versions, porting to other platforms came afterwards.

~~~
keithnz
Can you say how those make it incoherent? 3 different ways to define a
function, a breaking change in the language a while back. And only their
implementation run time was tied to the OS, Mono came along and provided
another

