Hi, I created a tool for debugging the compiler. You can log any function. It actually modifies your function, before each line it checks the local variables, prints them (if they were newly introduced or modified), and also prints the lines in the code, and the stack, if it was modified.
The tool is not documented. If there is interest, then I can spend more time with it. I know that it is not perfect. [https://github.com/petermora/nimTracelog](https://github.com/petermora/nimTracelog) Peter