I'd be interested in more details about your use case. Usually with structs, defining them is the easy part. The hard part is all the functions that use the struct. As long as that "something" that doesn't have "nested type support" really only is about defining the struct and involves nothing else, fine, then just generating the right struct definition might be the hard part, but I'm having a hard time imagining what that "something" could be. ... It would seem likely (to me) that you would want to use that generated struct somehow, and if that's done by manually accessing the relevant fields, I'd be wondering why a manual implementation of the flattened struct wouldn't be easier and more clear; on the other hand, if accessing the structs doesn't happen manually but in generated code, then that seems a way harder or at least significantly different problem compared to just generating the struct definitions.