Common Language Runtime (CLR) in .Net
CLR Execution Model

Common Language Runtime (CLR) in .Net

Before C# we have to language in the C family C/C++.

Using C or C++ our application compiler translated our code into name code (machine code).

Which means if I wrote an application in C++ on a Windows machine with 8086 processor architecture the compiler will translate our code into native code (machine code).

What if we have different hardware ?!! What if we have a different operating system ?!!

Ans: that will not run😔

Article content
The Process of translating Code into Machine Code (Native Code)

When Microsoft was designing C# and .Net framework they came with an idea that they borrowed from the Java community.

So now when you compile C# code the result will be intermediate language (IL) code.

Now we need something that would translate that IL code into native code (machine code) that is the job of CLR (common language runtime).

So CLR is essentially an application that is set in the memory whose job is to translate the LI code to machine code, and this process is called just-in-time compilation (JIT).

Article content
The Process of translating C# Code into Machine Code (Native Code)

So with this architecture, you can write an application in C# and you don't have to worry about compiling that into native code for different machines as long as the machine has CLR that can run your application😄


Article content
CLR Execution Model


Ahmed Eltofany

Senior Software Engineer | .NET | Angular | Microservices | DDD | Always Learning, Always Growing

1y

good job Samy, Keep pushing forward.

Ahmed Fathi

Software Engineer - Opinions are my own 🍉

1y

Thanks for sharing! Keep it up!

To view or add a comment, sign in

More articles by Mohamed Samy

  • Understanding CI/CD Pipeline: Key Concepts, Workflow, and Platform Options

    A CI/CD pipeline is essential for modern software development as it enables automation, consistency, and reliability…

  • Cross-Site Request Forgery (CSRF) Attack

    What is CSRF? CSRF attacks occur when a malicious website tricks a user's browser into making unintended requests to a…

  • The Hi/Lo Algorithm

    The Hi/Lo Algorithm is also known as the High-Low Algorithm. it is useful for generating unique keys for entities…

  • Asymmetric Encryption

    Encryption is the process of taking a message and scrambling its contents so that only certain people can look at your…

  • The Purpose of Asynchronous Code

    Writing async code on the server is all about freeing up threads as soon as possible so they can be used for other…

  • CAP Theorem

    What is the CAP theorem? How useful is it to system design? Let’s take a look. The CAP theorem is a concept in computer…

    1 Comment
  • Delegates and Events In C# .NET

    The concept of events and delegates is a little bit confusing for some of us. I was one of them when I started.

  • Difference between System Design and System Architecture

    System design and system architecture are related concepts in the field of software and systems engineering, but they…

Insights from the community

Others also viewed

Explore topics