~/talk

Let's Code an incremental source generator with Roslyn

Talkat NDC Oslo 2023 · 2023-05-22..05-26· [dotnet]
slides:none on file

Live codes an IsEnumDefined generator that emits .g.cs methods from partial types using Microsoft.CodeAnalysis.CSharp.Workspaces and multi-targeted netstandard2.0 binaries, verifies behavior with Roslyn unit tests and mutation testing, and measures wins with benchmarks showing no boxing allocations and noticeably lower GC pressure for logging scenarios. Implementation uses an incremental pipeline with custom equality comparers to avoid full re-generation on whitespace edits, outputs auto-generated files and works under SDK 6.0.4+ with C# 11.

AI-written summary · about

  1. 0:00Introduction
  2. 2:30Roslyn and Source Generators
  3. 8:52Source Generator use cases
  4. 14:17Syntax trees and semantic models
  5. 22:24Building a generator step by step
  6. 33:53Incremental generator anatomy
  7. 41:34Incremental pipeline
  8. 51:21Code generation and debugging
  9. 53:12Performance pitfalls
  10. 57:36Best practices
  11. 58:37Resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.