Swipe
SwipeSwipe
Swipe Apps

Paths

Motivation

Information

How C# Works · Lesson 6 of 27

Compiler

A free lesson from Swipe Coding · C#, level 1 · updated October 2026

By the Swipe team, founded by Colin · how we make lessons

🤖
Your code needs a translator before the computer can run it — meet the compiler. 🔧

You now know that source code is human-readable, but the computer cannot execute it directly. This is exactly where the "compiler" comes in — a program that translates your source code into something closer to what a computer can process.

The C# compiler is called "Roslyn". It reads your .cs file(s) and translates them into a new form that can eventually be run. This process is called "compiling", and today it's most commonly triggered with a single command using the .NET command-line tools.

dotnet build
This is how you typically trigger compilation: the "dotnet" command-line tool calls the C# compiler for you.
Fill in the blank

The modern C# compiler is called ____.

🤖
CIL is the next big idea — we dig into it properly next lesson. 👀

Important: the compiler does not translate your code directly into machine language for a specific processor. Instead, it produces a special intermediate form called "Common Intermediate Language", or CIL — more on that in the next lesson. This intermediate form is a big part of what makes .NET so flexible across different platforms.

The compiler also checks your code for errors. If, for example, you made a typo or forgot a bracket, the compiler stops with an error message and does not produce a translated file. This is called a "compile error" (or "build error").

Quick check

What happens if your C# source code contains a typo?

True or false

The C# compiler translates source code directly into machine language for a specific processor.

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 →