In Technologies
15
277 views

History Prevails…

Before starting with CLR you need to understand .NET Framework first. So, actually what is .NET Framework?

Well, it is a software framework in which we design and create wonderful applications (windows, web & mobile). This framework is introduced by Microsoft and backed by its community which means it has great future with head support.

There are total 8 numbers release of release come to till now given below :
  • .NET Framework 1.0     {Release date 2002-02-13}
  • .NET Framework 1.1     {Release date 2003-04-24}
  • .NET Framework 2.0    {Release date 2005-11-07}
  • .NET Framework 3.0    {Release date 2006-11-06}
  • .NET Framework 3.5    {Release date 2007-11-19}
  • .NET Framework 4.0    {Release date 2010-04-12}
  • .NET Framework 4.5    {Release date 2012-08-15}
  • .NET Framework 4.6   {Release date 2015-07-20}
  • .NET Framework 4.7   {Release date 2017-04-05}

What Are The Components Of .NET Framework?

.NET Framework contains lots of component and CLR is the Key component for it and following is another component in Dot Net Framework, which we will discuss and other blogs.

  1. .NET Framework Class Library.
  2. Common Language Runtime. – Will discuss in this blog
  3. Dynamic Language Runtimes(DLR)
  4. Application Domains.
  5. Runtime Host.
  6. Common Type System.
  7. Metadata and Self-Describing Components.
  8. Cross-Language Interoperability.

Introduction To CLR

The Common Language Runtime (CLR), the main machine or key component of Microsoft Dot Net Framework and it manages the total execution of .NET programs. A process known as JIT ( just-in-time compilation) converts compiled code into machine language which the computer’s CPU then executes.

Under .NET Framework, there are categories the code into two type first manage code which runs and executed under CLR environment and unmanaged code which not run and execute under CLR environment.

What is Manage Code?

Managed code is the resultant output of source code done by the compiler and that code is written in one of over 20 high-level programming languages that are used with the Microsoft .NET Framework, Example C#, J#, Microsoft Visual Basic Dot NET, Microsoft JScript and Dot NET, while unmanaged code refers to programs written in C, C++, and other languages that do not need a runtime to execute.

CLR

Features Of Common Language Runtime

CLR provides additional services including Base Class Library Support, thread management, memory management, type safety, exception handling, garbage collection and security. All programs are written for the .NET framework, regardless of programming language, are executed by the CLR. All versions of the .NET framework include CLR.

Base Class Library Support It provides supports through class libraries to an application.

Thread Management: The execution of code parallel is called Threading and threads are runs under the Common Language Runtime. Threads are basically lightweight processes responsible for multitasking within a single application.

COM Marshaler: Helps in communication between the COM objects and application.

Type checker: Type Checkers Like CLS or CTS will verify types used in the application standards supported by CLR, this provides type safety. The MSIL code which is compiled output of the written code in any language supported by .NET Framework is same and at this stage, a code has a feature of interoperability.

Common Language Specification (CLS): Common Language Specification (CLS) under CLR is a set of rules to which languages must flow in order to make compatible with other .NET languages.

CTS (Common Type System): Data types of class members which are created in two different languages get compiled into base common data type system.

The following can be regarded as the functions of Common Type System:

Make possible framework to be cross-language integration or platform independent, type safety, and high-performance code execution.

Defines rules that languages must follow, which helps ensure that objects written in different languages can interact with each other.

Provides primitive data types (such as Boolean, Byte, Char, Int32, and UInt64) used in application development.

This topic contains the following sections:

Types in DOT NET

Type Definitions

Type Members

Characteristics of Type Members

Types of DOT NET

All types in .NET are either value types or reference types.

Value types are data types whose objects are represented by the object’s actual value. If an instance of a value type is assigned to a variable, that variable is given a fresh copy of the value.

Reference types are data types whose objects are represented by a reference (similar to a pointer) to the object’s actual value. If a reference type is assigned to a variable, that variable references (points to) the original value. No copy is made.

The common type system in .NET supports the following five categories of types:

  • Classes
  • Structures
  • Enumerations
  • Interfaces
  • Delegates

Security Engine: It enforces security permissions at code level security, folder level security, and machine-level security using Dot Net Framework setting and tools provided by Dot Net.

Garbage Collection: Garbage Collector automatic release memory of unused objects in an application and can be done by CLR automatically or by forcefully by writing a code in an application that how memory management happens in CLR.

How JIT(JUST-IN-TIME) Works?

In short, our code gets compiled two times. On the first pass, it is compiled from higher language to MSIL(Microsoft Intermediate Language) and On the second pass, the code (now an assembly in MSIL) is compiled into machine language which is understandable by the operating system. This process is called Just-In-Time JIT compilation because it does not occur until the assembly is on the target machine. Due to this, the assembly is compiled in a very optimized and fastest possible machine language code and it also enhanced for your specific configuration.

Description

Pre-JIT COMPILER:

Pre-JIT compiles complete source code into native code in a single compilation cycle. This is performed at the time of deployment of the application.

Econo-JIT COMPILER:

Econo-JIT compiles only those methods that are called at runtime. However, these compiled methods are removed when they are not required.

Normal-JIT COMPILER:

Normal-JIT compiles only those methods that are called at runtime. These methods are compiled the first time they are called, and then they are stored in a cache. When the same methods are called again, the compiled code from a cache is used for execution.

These methods are compiled the first time they are called, and then they are stored in a cache. When the same methods are called again, the compiled code from a cache is used for execution.

Any confusion or suggestions? Feel Free to add your valuable comments in same regards!

Recent Posts
  • Mrityunjay Giri

    Simple language and topic to topic is very good ….. <3

    • Ravi Kapruwan

      Thank you.

      • Mrityunjay Giri

        Your welcome.

  • Ashish Singhal

    Very useful and I appreciate your work 👍

    • Ravi Kapruwan

      Thanks , it’s my pleasure.

  • Ritika Negi

    Valuable information…

    • Ravi Kapruwan

      thank you dear

  • Sameer Badola

    This blog is very helpful to learn CLR as quickly and efficiently as possible.

    • Ravi Kapruwan

      thanks dude

  • Sheetal Bhat Raina

    Nice blog

    • Ravi Kapruwan

      Thanks for your valuable reply.

  • Nikita Sharma

    nice blog

    • Ravi Kapruwan

      Thanks for your valuable comment. 🙂

  • Kapruwan Raj

    Awesome blog buddy .. 😎

    • Ravi Kapruwan

      thank you dost

We Are Here to Help!
Name:
Phone:
Email:
Country:
Message:
Captcha:
 

Start typing and press Enter to search