Top
image credit: Unsplash

Source Generators Will Enable Compile-time Metaprogramming in C# 9

May 11, 2020

Via: InfoQ

Source generators are a new feature of the C# compiler that enables inspecting user code using compiler-generated metadata and generating additional source files to be compiled along with the rest of program.

Loosely inspired by F# type providers, C# source generators respond to the same aim of enabling metaprogramming but in a completely different way. Indeed, while F# type providers emit types, properties, and methods in-memory, source generators emit C# code back into the compilation process.

Read More on InfoQ