Florian Rappl
Building a Compiler with C#
#1about 4 minutes
Understanding the Roslyn compiler platform for C#
Roslyn is more than a black-box compiler, providing rich language service APIs that power IDE features like refactoring and code analysis.
#2about 2 minutes
Exploring C# code with Roslyn and LINQPad
Use a tool like LINQPad to see how Roslyn transforms C# source code into intermediate language (IL) and visualizes it as a syntax tree.
#3about 4 minutes
The motivation for building a custom language
A custom, high-performance language was needed to power a game that dynamically generates worlds from user-defined mathematical formulas.
#4about 3 minutes
Defining a language with a formal grammar
Creating a new language starts with a formal specification or grammar that defines its syntax using symbols and rules.
#5about 3 minutes
How compilers transform source code into executables
Compilers translate source code into a machine-readable format, either directly into object files or into platform-independent bytecode for a virtual machine.
#6about 5 minutes
The core stages of parsing source code
The parsing process involves multiple stages, including stream processing, tokenization, abstract syntax tree (AST) generation, and semantic analysis.
#7about 6 minutes
Structuring code with an Abstract Syntax Tree
An Abstract Syntax Tree (AST) represents code structure using nodes for statements and expressions, respecting operator precedence.
#8about 3 minutes
Traversing the AST using the Visitor Pattern
The Visitor design pattern provides a robust and type-safe way to traverse an Abstract Syntax Tree for analysis or code generation.
#9about 3 minutes
A live demo of a custom language REPL
A simple Read-Eval-Print Loop (REPL) demonstrates the custom language's features, including function definitions, currying, and AST inspection.
#10about 2 minutes
Implementing operator precedence with Pratt parsing
Pratt parsing is a technique that uses recursive function calls to elegantly handle operator precedence climbing in a compiler.
#11about 4 minutes
Understanding virtual machines and intermediate language
Process virtual machines execute platform-independent bytecode, or intermediate language (IL), which provides a linear instruction set derived from the AST.
Related jobs
Jobs that call for the skills explored in this talk.
Senior Softwareentwickler (m/w/d)
PROSOZ Herten GmbH
Herten, Germany
Remote
€59-80K
Intermediate
Senior
.NET
C#
+3
Software Developer – Core API (f/m/d)
Dennemeyer Group
Hesperange, Luxembourg
Intermediate
Senior
.NET
Structured Query Language (SQL)
Senior Fullstack Engineer – Angular/.Net (f/m/d)
Apaleo
München, Germany
Remote
€65-85K
Senior
JavaScript
.NET
+2
Matching moments
00:57 MIN
What are C# source generators and how they work
C# 9 Source Generators - let the machine do the programming
07:43 MIN
Distinguishing between interpreters and compilers
Making Sense of Programming Languages
00:04 MIN
The value of understanding language internals
Making Sense of Programming Languages
00:18 MIN
Defining C# lowering and its benefits
C# Lowering - What is it and why should I care?
23:35 MIN
Q&A on compiler adoption and the move to full-stack
To New Frontiers: The Future of Frontend Development
45:21 MIN
Summary and key takeaways for source generators
C# 9 Source Generators - let the machine do the programming
00:25 MIN
A developer's journey through programming languages
Coffee with Developers - Martyn Kilbryde
00:10 MIN
Why Blazor enables full-stack .NET development
Blazor Unleashed: The Future of .NET Web Development
Featured Partners
Related Videos
Hacking C# from the inside - how to do anything in NET
Adam Furmanek
Exploring the Latest Features of .NET and C# by Building a Game
Rainer Stropek
Microfrontends with Blazor: Welcome to the Party!
Florian Rappl
Making Sense of Programming Languages
Aleksandra Sikora
C# 13 Unleashed: Live Demos of my Top 10 Cutting-Edge Features!
Ambesh Singh & Sachin Kumar
C# Lowering - What is it and why should I care?
Steven Giesel
Just-in-time Compilation in JVM
Daniel Strmečki
Livecoding with AI
Rainer Stropek
Related Articles
View all articles



From learning to earning
Jobs that call for the skills explored in this talk.

Software Development Engineer - LLVM Compiler
Advanced Micro Devices
Bristol, United Kingdom
API
C++
Linux








Fullstack-Developer .NET, C#, ASP.NET, React, TypeScript
Halvotec GmbH
Raubling, Germany
.NET
React
ASP.NET
TypeScript
Software Architecture