> How reliably can Nim translate to C or C++?

As with any other compilers: nothing but [a bunch of test 
cases](https://github.com/nim-lang/Nim/tree/v0.17.0/tests), which is why code 
generation bug can still exist because covering all cases is almost impossible. 
Compiler's basic building block is a node in its hierarchical syntax tree, 
which maps to one or several (hopefully not too many) instructions in the 
_target architecture_ (in which it's possible to create one based on any other 
language including C and C++). By ensuring these nodes produce correct 
instruction sequence, the whole tree can be assumed to be as correct, but of 
course it's not easy to prove and corner cases do exist, along with 
optimizations that can modify the tree wrong.

Reply via email to