While we are referring to .NET (pronounced as dot NET), it is .NET Full, as we have .NET Core in place and we are using .NET Core in our book examples with C# 7.0 as the language. Before moving ahead, you should know about .NET because there is a .NET Standard available with the .NET Core, that is API servers for both .NET Framework as well .NET Core. So, if you created a project using .NET Standard it is valid for both .NET Framework and .NET Core.
.NET is nothing but a combination of languages, runtime, and libraries, by using which we can develop managed software/applications. The software written in .NET is managed or is in a managed environment. To understand managed, we need to dig into how binary executables are available for operating systems. This comprises three broader steps:
- Writing the code (source code).
- Compiler compiles the source code.
- The operating system executes the binary executable immediately:
The preceding process is a standard process depicting how compilers compile the source code and create executable binaries, but in the case of .NET, the compiler (C# compiler for our code) does not directly provide a binary executable; it provides an assembly and this assembly consists of metadata and intermediate language code, also known as Microsoft Intermediate Language (MSIL) or Intermediate Language (IL). This MSIL is a high-level language and this can’t be understood directly by the machine, as MSIL is not machine-specific code or byte code. For proper execution, it should be interpreted. This interpretation from MSIL or IL to the machine language happens with the help of JIT. In other words, JIT compiles MSIL, IL into the machine language, also called native code. For more information, refer to https://msdn.microsoft.com/en-us/library/ht8ecch6(v=vs.90).aspx.
For 64-bit compilation, Microsoft has announced RyuJIT (https://blogs.msdn.microsoft.com/dotnet/2014/02/27/ryujit-ctp2-getting-ready-for-prime-time/). In the coming versions, 32-bit compilation will also be handled by RyuJIT (https://github.com/dotnet/announcements/issues/10). After this, we can now have a single code base for both CoreCLR.
Intermediate language is a high-level component-based assembly language.
In our seven days of learning, we will not focus on the framework, but we will be more focused on the C# language with the use of .NET Core. In the coming sections, we will discuss important things of .NET Core in such a way that while we work with a C# program, we should understand how our program talks with the operating system.