If you can write a meta program for it, you can execute that in CI and spit out generated code and be done with it. This is a viable approach in any programming language that can print strings to files.
It’s not frustrating, but maybe it feels tacky. But then you shrug and move on to the real task at hand.
One such example is the let-alist macro in elisp
https://www.gnu.org/software/emacs/manual/html_node/elisp/As...
Dealing with nested association lists is a pain. this let you write your code with a dot notation like jq.
Macros are not only for solving a particular task (serialization, dependency injection, snippets,…) they let you write things the way it makes sense. Like having html-flavored lisps for template, sql-flavored lisp for query,… Lisp code is a tree, and most languages are trees, so you can bring easily their semantic in lisp.
Meta-heavy code usually offers a nice DSL, but is proportionally harder to drill down through.