C# meta programming game is strong. Source generators are :chefs_kiss:
This seems like the kind of feature that should be built into MSBuild.
So it's like C++ consteval?
Makes me think of Boo language; Boo was so good at metaprogramming and multi-phasr programming! A very fine .NET language that was so far ahead of the curve, with having the tools of that language be usable at runtime.
Alas many of the docs are offline now. But it had great quasiquotes, which let you write code that gets turned into AST that you can then process. Good macros. A programmable compiler pipeline. So much. Alas, obscured now. https://boo-language.github.io/
I think Zig really shines here: https://ziglang.org/documentation/master/#comptime