World Congress 2021 Jun 30, 2021

C# 9 Source Generators - let the machine do the programming

Jiří Činčura

Stop relying on slow runtime reflection and endless boilerplate. C# 9 Source Generators tap native compiler features to generate high-performance, strongly typed code on the fly.

Pause
Mute Enter Fullscreen
#1 about 2 min

Overview of C# source generators and compilation pipeline

How meta programming allows code generation during the compiler evaluation phase.

#2 about 7 min

Common use cases for source code generation scenarios

Automating reflection, zero-allocation parsers, serializers, typed APIs, and AOT compilation environments.

#3 about 3 min

Current design constraints and compilation stability in generators

Why generators are restricted to adding code without explicit ordering or modification abilities.

#4 about 7 min

Implementing a basic hello world source generator module

Adding a simple static method by interacting with syntax trees and the execution context.

#5 about 8 min

Dynamic code generation from CSV data file definitions

Using additional files in the compiler context to automatically generate nested placeholder objects.

#6 about 11 min

Automating the property changed boilerplate GUI implementation pattern

Utilizing syntax receivers to track customized attributes and output automatic object state event bindings.

#7 about 6 min

Generating handcrafted high performance serializers for specific objects

Filtering semantic object member properties to produce fixed and rapid serialization procedures.

#8 about 3 min

Managing generator internal and consumer runtime dependency configurations

Separating libraries needed to run the generator from consumer compilation runtime dependencies.

#9 about 2 min

Reporting custom compiler diagnostics during the execution phase

Enhancing the developer experience by explicitly emitting contextual build warnings and compilation errors.

#10 about 2 min

Value proposition and compiler conclusions for library authors

How statically parsing semantic models heavily benefits component vendors through enhanced runtime profiles.

Matching moments

2:39 min

Understanding the basics of .NET source generators

Glenn F. Henriksen Glenn F. Henriksen · WWC Europe 2026

3:01 min

Implementing a basic source generator pipeline

Glenn F. Henriksen Glenn F. Henriksen · WWC Europe 2026

2:31 min

Abstractions and the push towards compiling natural language

Chris Heilmann +1 · LIVE

1:29 min

Addressing iterative code generation and developer challenges

3:07 min

Generating code structure clearly using partial properties

Ambesh Singh +1 · LIVE

1:30 min

Embracing code generation and modern editor evolution

Christian Heilmann Christian Heilmann · WWC 2025

Upcoming sessions on this topic

Open session

World Congress 2026 North America

When Humans Stop Writing Code: Rethinking Languages, Compilers, and Responsibility

Simon Auer

Organizer of flutter vienna meetup and CEO of marqably

Simon Auer
Open session

World Congress 2026 North America

The Broken Rung: How AI is Rebuilding Software Development from the Ground Up

Tomislav Tipurić

Chief Technology Officer, Nephos

Tomislav Tipurić
Open session

World Congress 2026 North America

Building Stuff with GenAI - The Open Minded Workshop beyond OpenAI

Andreas Erben

CTO for Applied AI and Metaverse at daenet

Andreas Erben
Open session

World Congress 2026 North America

The spectrum of agentic coding: From vibe coding to high-quality software engineering

YK Sugi

Developer Experience Manager at Eventual

YK Sugi
Open session

World Congress 2026 North America

Merging at Scale: From Broken Builds to Green Mainline

Manjari Akella, Preetam Dwivedi

Manjari Akella
Preetam Dwivedi
Open session

World Congress 2026 North America

Beyond Vibe Coding: An AI Builder’s Guide to Migrating 10k+ React Components

Shubham Chaurasia

Senior Software Engineer @ Meta

Shubham Chaurasia