If anyone was looking for yet another DSL for writing macros, here is a crappy one I just finished refactoring: https://github.com/n0bra1n3r/mast. Sample usage:
import mast
macro makeMain(body: untyped) =
ast:
ProcDef:
`main`
Empty
Empty
FormalParams:
Empty
Empty
Empty
(body)
makeMain:
echo "Hello world!"
# `makeMain` expands to:
proc main() =
echo "Hello world!"
Feel free to fork or just copy into your project. It's only ~60 lines long.