I've looked at the documentation of the compiler, and search on the 'Net, but I 
can't find how to tell the compiler to produce "formatted" backend generated 
code.

I've read somewhere that you can't debug Nim code directly, but that doesn't 
mater because you can just debug the generated code. I guess it might be a 
question of practice, but without any formatting, without original line numbers 
in comments, without original comments, and without the original Nim code as 
comments, I find it extremely hard to relate what I see in the nimcache to the 
code I wrote. This is obviously the default output, which can be compiled to an 
executable efficiently; nothing wrong with that. But as a human, I honestly 
can't make sense of this. And other code translation/generation tools I used 
before always had some (non-default) option to make the generated code "human 
readable". I guess I could run an automated code formatter on nimcache, but 
that wouldn't get me far as to the readability, without the original code in 
comments, and also then the lines in the formatted code would not match the 
debug info in the executable anymore.

Anyway, my goal atm is not to debug (I'm used to get by with "printf"), but to 
learn how the compiler converts Nim code to the chosen backend, so that I get a 
better "feel" for which construct is going to give me the desired result, be it 
to optimize performance, or memory usage, or to achieve the desired 
data-alignment in memory.

Reply via email to