I have an API defined in an XML. On the low level it only uses a few simple functions for passing messages, and the entire XML declares higher level functions that should be wrappers around them. How should I generate a file with those wrapper functions? Should I just manually construct them via string interpolation/concatenation and output them to a file? Or maybe do a module that uses metaprogramming to generate everything on compile? Or both? Is there a way to turn expressions generated via metaprogramming back into a sane script file?
For those interested, the API is Wayland. Its C implementation uses a tool called wayland-scanner, which reads the XML and generates adequate C headers file via string concatenation.