1 Performance. C compilers have thousands of years of effort put into them. 
That's hard to beat. You could use some thing like LLVM, but its basically C 
anyways. You could go Go or D route which emit their own native code but it 
took years for them to get close to the vcc, gcc and llvm speeds.

2 Compatibility. C/C++ compilers are very platform depended LLVM can't 
interface with steamsdk on windows for example only Visual C++ can. Emscripton 
which emulate many of the normal C things only exist for C/C++. Android NDK 
only works with C/C++. And same thing with iOS. You would have to build native 
compilers for tons of platforms, some times not documented or priority 
platforms. Why? Just emitting C gets you there.

3 Ecosystem. Building on the compatibility, Nim does not have that many 
libraries, but C/C++ has a ton. Yes you can wrap any C/C++ with your a 
hypothetical native code generator - but thats a ton of work. With Nim it's a 
lot easier. You can nearly just include the headers. It's great. I have created 
many wrappers for C libraries that just statically link.

At first I was skeptical, but it turns out emitting is one of Nim's strengths.

Reply via email to