Earlier quoted context omitted.
Source code generators are used because the language itself is not expressive enough. Maybe fix that instead.
That's not really true. Source generation is used at some level to implement expressivity at minimal runtime cost. It's just operating at a different level of abstraction to make different tradeoffs. Whether you do Foo.Serialize() and it uses reflection to enumerate the properties, carries around tags permanently or it uses some compiletime generated function has nothing much to do with expressiveness. If you design…
Thinking those are the only options is exactly why the issue is expressiveness.