Florian Rappl
Building a Compiler with C#
#1about 4 minutes
Understanding Roslyn as a compiler-as-a-platform
Roslyn is not just a compiler black box but a full platform with APIs that provide language services to IDEs and inspired the Language Server Protocol.
#2about 2 minutes
Visualizing code structure with Roslyn and LINQPad
A practical demonstration in LINQPad shows how Roslyn can expose the intermediate language and abstract syntax tree for any C# code snippet.
#3about 4 minutes
Why build a custom language for game development
The "majors" language was created to meet the performance demands of a game that dynamically generated 3D worlds from user-provided mathematical formulas.
#4about 3 minutes
Defining a new language with a formal grammar
Creating a new language requires a formal specification and grammar that defines its syntax and rules, which serves as the blueprint for the compiler.
#5about 4 minutes
Comparing native and managed compiler architectures
Native compilers produce machine-specific object files, while managed compilers generate platform-independent intermediate language like MSIL or bytecode to be run by a virtual machine.
#6about 5 minutes
The four fundamental stages of compiler parsing
The compiler's front-end processes code through four stages: decoding the byte stream, tokenizing characters into blocks, generating an abstract syntax tree, and performing semantic analysis.
#7about 5 minutes
Representing code structure with an abstract syntax tree
The abstract syntax tree (AST) is a crucial data structure that represents code hierarchically, distinguishing between statements and expressions and enforcing operator precedence.
#8about 3 minutes
Traversing the abstract syntax tree with the visitor pattern
The Visitor design pattern provides a type-safe and extensible method for traversing an abstract syntax tree using a dedicated TreeWalker class for analysis or code generation.
#9about 3 minutes
A live demonstration of a custom language REPL
A live demo showcases the custom "majors" language REPL, including its support for function definitions, currying, and a built-in command for inspecting the AST.
#10about 3 minutes
Implementing operator precedence with Pratt parsing
The Pratt parsing technique simplifies handling operator precedence by using a hierarchy of recursive function calls that naturally builds the correct abstract syntax tree.
#11about 4 minutes
Transforming the AST into a linear intermediate language
The compiler flattens the hierarchical abstract syntax tree into a linear sequence of instructions, known as intermediate language, for efficient execution by a process virtual machine.
Related jobs
Jobs that call for the skills explored in this talk.
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
Making Sense of Programming Languages
Aleksandra Sikora
Microfrontends with Blazor: Welcome to the Party!
Florian Rappl
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.








