Re:Zig's Comptime Is Bonkers Good
by michaelsbradley on Tuesday January 07, 2025 @02:31PM
(#42626343)
To debug macros in Nim, you'll likely need to print arguments and expansions at compile-time, inspect the output, change things to see what happens, repeat...
https://nim-lang.org/docs/macros.html#toStrLit%2CNimNode
https://nim-lang.org/docs/macros.html#astGenRepr%2CNimNode
https://nim-lang.org/docs/macros.html#dumpAstGen.m%2Cuntyped
https://nim-lang.org/docs/macros.html#treeRepr%2CNimNode
https://nim-lang.org/docs/macros.html#dumpTree.m%2Cuntyped
https://orlybooks.com/books/changing-stuff-and-seeing