C# Code Generators: Writing Code That Writes Code
summary
The talk explains C# source generators introduced with C# 9 and .NET 5 (Roslyn), contrasting them with older tools like PostSharp, Fody, and CodeSmith. It covers how generators run at compile time with access to compiler internal data structures, shows examples of writing C# generators, and discusses scenarios and benefits (e.g., replacing slow reflection) so listeners can build their own generators.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 1:54What are code generators
- 4:43How code generators work
- 9:48Creating and using generators
- 26:18Generator demo
- 32:00Q&A
related talks
01h 12mC# Source Generators in Action
54mExploring Source Generators
01h 02mRoslyn Source Generators Never send a human to do a machine's job
01h 15mLet’s Build an Incremental Source Generator With Roslyn
01h 04mLet's Code an incremental source generator with Roslyn
59mSource generators v2.0 — Incremental Generators
51mThe Future of C#
01h 01mDynamic Runtime Code with Roslyn
