Hello.
In C# reflection can be used to get all types from assembly, filter them by type info such as attributes, interfaces, etc. Then on every filtered type run some arbitrary code, in this case generate code according to reflection type info data. Generating code for C# this way doesn't happen during compilation, and I'd like to know if Nim could generate Nim code during compilation phase.
The introspection capabilities of Nim's macro system do not allow for "get all types" etc.
One good option is to use the Nim compiler as a library, see https://github.com/nim-lang/Nim/blob/devel/tests/compilerapi/tcompilerapi.nim for an example.