Nim macros are one of the powerful way to extend nim code through metaprogramming.
There are a number of handy functions in std/macros that help to debug them as well in development.
std/macros
ref pmunch
my macros