Hey Jasim, this post was one of the first things I found to read when I started my latest open source project.
I think the solution is in reframing the problem. It’s not about finding the right abstraction and then generating code from that, but rather tying all the existing abstractions we use together in an automated manner. I wrote a little white paper on my solution. Would love to hear your thoughts. https://useoptic.com/docs/#/another-code-generator