Evolving Roslyn Source Code Generators

I am a big fan of Roslyn Source Code Generators – you can read about at https://github.com/dotnet/roslyn/blob/main/docs/features/source-generators.md and https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/. I have tested , until now, 27 examples and discovered other 53 RSCG – you can read about at https://github.com/ignatandrei/RSCG_Examples and download the book from  https://ignatandrei.github.io/RSCG_Examples/

Also, Microsoft is dogfooding this by using at Blazor ( https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-6-preview-2/#razor-compiler-updated-to-use-source-generators ), JSON.NET https://devblogs.microsoft.com/dotnet/try-the-new-system-text-json-source-generator/ . This will alleviate some of the pain points from https://turnerj.com/blog/the-pain-points-of-csharp-source-generators .

Now Microsoft is evolving the specification . I have read about Incremental Generators – https://github.com/dotnet/roslyn/blob/main/docs/features/incremental-generators.md . This sounds promising – and the fact that is called “Incremental” , that can generate more than source code and can be cached sounds great. Let’s see !