First, Nim generally is not slower than C. You can write Nim code which is 
translated straight to C. But of course you may use high level constructs, 
which may be a bit slower, or you may do too many heap allocations for example, 
which can make your code a bit slower. And maybe some library modules are not 
yet as fast as they could be.

Advantage of C++ backend can be, that C++ supports exceptions, with no or 
minimal runtime overhead. Plain C does not, so some people may prefer compiling 
to C++.

Java-Script backend -- well that is the language of the web, so it is good that 
Nim supports it. And finally, there is also a LLVM backend available already, 
with some restrictions.

When you are really looking for disadvantages of Nim compared to C -- well Nim 
executables are small, but not so tiny as a C hello-world of only about 10k. 
Because Nim has a small runtime library and Garbage-Collector support in its 
executable. But thinking about that, my former statement is not really true, as 
we can compile Nim using runtime and GC as external libs, so executable is 
indeed only a few kB. So maybe GC is only remaining disadvantages. But with 
newruntime we may be able to use Nim without GC, and for most apps GC is no 
problem at all. 

Reply via email to