I've used code generation at work quite a bit, whenever I've had somewhat repetitive code to write that I couldn't factor away. It makes my job a lot less tedious and more fun.
I've used code generation at work quite a bit, whenever I've had somewhat repetitive code to write that I couldn't factor away. It makes my job a lot less tedious and more fun.
I'm at a C# shop myself, and generally just write my generators in C#. Just spitting out strings of sourcecode and writing them into files. I would think Clojure would be better for this sort of thing, since it's got macros.
On the other hand, doing it in C# worked really well for one project, because after writing the generator I realized that I could convert it from a compiler into an interpreter, and make a program that didn't need a generator after all because it was so flexible at runtime.
http://www.amazon.com/Code-Generation-Action-Jack-Herrington...