Skip to main content

Posts

Showing posts with the label virtual machine

How to get the CoreCLR source code, compile it and some really interesting things found inside

A couple of months ago I had the chance to look a bit into the famous CoreCLR source code and actually compile it. It took me a while to understand it and how use it. This is probably some really advanced stuff that most of the time you don't need to know. It is actually composed of 2 main parts. One is the actual virtual machine which takes and runs the intermediate language code. The other part is the actual core .net library called "System.Private.CoreLib.dll" with the base types such as the string type or the numeric types. The second  These 2 parts are strictly related together. They need to have the same version and build type, release or debug. The second part that contains the source code for the core type in .Net is actually a separate assembly written in C#. The unusual thing here is that people expect the types to be in "System.Core.dll" but it's not. That assembly is just a stub for the real assembly containing the actual implementation for the...

A glance at the insides of the CoreCLR

So these past days I was kind of bored and also I wanted to prove to myself that I can take a serious software project and the understand it. I heard so many things about the CLR like it was some kind of alien technology that no one could understand. I saw that it as a challenge and decided to see if it's really like that. And the rumors were true in a way. The CLR is a marvel of software engineering. It is actually made out of multiple systems with one central system that glues them together. That central system is called the "Execution Engine". I think it's what controls and manages the execution of the program. It is for example responsible for stopping the execution of the program when the garbage collector starts to do it's job. Actually the garbage collector sends a command to the execution engine to stop the execution of the program. Yes, the garbage collector is another system just like the execution engine. It is actually pretty interesting to see how...