I tripped (again) over the "no side effects" pragma. This time while reading the Tips&Tricks in the wiki on GitHub.
To me a side effect is output but I tried it before and echo worked in a proc with the no side effects pragma. I thought the pragma is not working or needs some special compiler switches so I passed on it at that time.
Now I saw debugEcho mentioned in the wiki page and tried again. First thing I noticed is that {.noSideEffects.} from the wiki pages seems to be wrong and has to be {.noSideEffect.}. Second echo works for me in a proc marked with that pragma. I then tried to access a global variable and I finally got Error: 'nono' can have side effects!
I would mess with the wiki page if I would not be totally new to Nim and fear that I miss something! Whats up with echo being allowed?
Well, it's a bug. Not sure if a regression or not:
https://github.com/Araq/Nim/issues/2011
EDIT: It's a regression. echo's implementation changed quite a bit.