Common Language Runtime (CLR)
A free lesson from Swipe Coding · C#, level 1 · updated October 2026
By the Swipe team, founded by Colin · how we make lessons
You have learned that the compiler produces CIL (packaged inside an assembly) from your source code. But who actually executes this CIL? The answer: the "Common Language Runtime", or CLR for short.
The CLR is a program that runs on your operating system and reads CIL. Using a technique called "Just-In-Time" (JIT) compilation, it translates the CIL into the machine language that your specific device's processor understands — right as the program runs, whether that's a Windows PC, a Mac, or a Linux server.
dotnet run
The CLR uses ____-In-Time compilation to translate CIL into machine language as the program runs.
Beyond translating CIL, the CLR also manages important background tasks for your program: it automatically frees up memory that is no longer needed (a process called "garbage collection"), enforces C#'s strong typing rules, and handles errors that occur while the program is running.
The CLR automatically manages memory for a running C# program through garbage collection.
The complete process looks like this: you write Program.cs (source code). The Roslyn compiler translates it into an assembly containing CIL. The CLR reads that assembly and executes it, JIT-compiling the CIL into machine code for your device along the way.
What is the main job of the Common Language Runtime (CLR)?
Keep your streak going in Swipe Coding
Swipe through every level of C# on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.
Get the Swipe apps →