Introduction of .Net Core Compilation

  • .Net Core
  • DotNet CLI
  • Mehdi Mohseni
  • March 2, 2020
  • Home
  • Blog
  • Introduction of .Net Core Compilation

Introduction

After .Net Core has been entered in the field of programming languages, many of us .NET developers inevitably chose to migrate from .Net Framework to .Net Core. What was initially very similar to .Net Framework after a while showed that it has serious differences with its father.
In this article, I will try to briefly explain the history of .NET Framework and its progress to .Net Core. I will also tell you how our .Net Core codes will be compiled.

Background

Let’s get started with the history of the .Net Platform introduced by Microsoft Corporation.

I haven't included .Net 5 in the timeline. That is based on .Net Core 3 but it's also the end of both .Net Core and .Net Framework

.NET Framework
  • A development platform for building web applications, services, and mobile applications.
  • It contains a common language runtime (CLR) and, the .NET Framework class library that support an extensive range of technologies.
  • Runs on Windows OS only.
  • The most recent official release of .NET is 4.8
.NET Core Framework
  • Modular and smaller implementation of .NET.
  • Cross-platform and Open Source. So we can run it on Windows, Linux, and Mac operating systems.
  • It supports containers such as Dockers, Kubernetes, etc.
  • It supports Microservices Architecture.
  • Optimized for high performance and scalability.
  • It supports Cross-platform development tools – VS Code, Dot Net CLI.
  • The last version is 3.x, Microsoft announced that it will not release newer any major version after 3.x and .Net 5 will the next version of both Framework and Core.
What .Net Core is not supporting?
  • Asp.Net WebForms
  • ASMX Web Services
  • Windows Communication Foundation (WCF)

So, these are the things actually we can not develop on top of .Net Core but It doesn't mean that I can not consume the WCF like ASMX services in a .Net Core application. We can consume but can not develop. There is a known way called Middleware in .Net Core which makes it possible to develop and host WCF services.

.NET Core and .NET CLI Compilation

.Net Framework Compilation

.Net Core Compilation

What is the Roslyn

The main mission of the Roslyn project is to unlock the process of compiling black boxes and the possibility of using the ultimate tools and users in the wealth of information compilers about our code.
Instead of translating source code and object coding, through the Roslyn project, compilers become services - APIs that you can use to work with code in your tools and applications.
Roslyn makes possible to building code analysis tools with the same APIs that are used by Visual Studio.

What we know about CoreCLR

CoreCLR is the .NET execution engine in .NET Core, performing functions such as garbage collection and compilation to machine code. .NET Core is a modular implementation of .NET that can be used as the base stack for a wide variety of scenarios, today scaling from console utilities to web apps in the cloud. I really recommend reading this Microsoft article which is the main source of my article.
In Summary CoreCLR:

  • Runtime implementation of .NET Core.
  • A group of technologies that are fundamental to the runtime, such as RyuJIT, Garbage Collector, native interop, and many other components.
  • The CoreCLR is cross-platform and CLR is not.
the amazing thing about the CoreCLR is that the CoreCLR is totally open-source application. You can find the source code on Github.

RyuJIT, The next-generation x64 JIT compiler

RyuJIT is a new, next-generation x64 JIT compiler that compiles code twice as fast is ready to change your impressions of 64-bit .NET code.

  • Next-generation Just-In-Time (JIT) compiler for .NET Core based on x64.
  • Supports High-performance JIT architecture, focused on high throughput, JIT compilation.
  • The new JIT is twice as fast, meaning apps compiled with RyuJIT start-up to 30 percent faster.

Related Post