Guile-lips: Scheme as a generic macro language
I think many will agree that the import statement example is fairly weak. If you are writing import statements by hand you should just seriously consider the benefits of using an IDE.<p>That being said I use code generation instead of the IDE all the time but for harder things like generating fluent builders , copying objects, generating visitor pattern for pattern matching etc.<p>What I do is write Groovy scripts and will either use Groovy GString templates or Squares Poet to generate code.<p>What I do though instead of making some sort of DSL is use a subset of the language itself to help the code generator. For example copying a list of private fields I can quickly turn into either an immutable object with builder or an interface or just a plain object copy etc etc.<p>I put my Groovy scripts in my ~&#x2F;bin and then just keep my terminal running. I then copy from Eclipse&#x2F;Intellij some code and then run:<p><pre><code>   pbpaste | SomeGroovyTransformScript.groovy | pbcopy
</code></pre>
Then paste back the code into the IDE. Ideally I would use APT libraries (and in same cases I have converted Groovy code into APT libraries) but some times I just want something lightweight.