Both of those are too much DSL (imo). My approach involved no business logic, because that never works out, and focussed on generating/maintaining boilerplate, while also allowing users to modify the generated code and have it survive regen (diff3)
https://hofstadter.io/code-generation/
I'm migrating / renaming / cleaning up the project this week
https://github.com/verdverm/veg