Looking at this line
    
[(1)](https://github.com/cdunn2001/compile-times/blob/91c41d81a1ccb46406bf64eb9f923ee6eacdd679/driver.py#L22),
 which I assume to be the actual command that runs the Nim compiler, it seems 
that you're not using [tcc](https://en.wikipedia.org/wiki/Tiny_C_Compiler), 
which is several times faster than both GCC and Clang.

Please add the following option to the compiler invocation: 
    
    
    --cc:tcc
    
    
    Run

It should shave a few seconds off of Nim's result.

> nim itself is the main cost

Unless I'm misremembering, Araq said that the compiler doesn't implement 
incremental compilation yet, so there's that.

> I was wondering if anyone knows what sorts of things would compile much 
> faster in Nim than in C++

Well, anything really. The problem with C++ is that its syntax is so ambiguous 
that any bit of code could possibly be anything and do anything. Also, the 
consensus seems to be that using C++ templates slows the compiler down to a 
crawl. In comparison, I never had much of a problem with Nim macros. Also, 
there is no TCC equivalent for C++ that I know of, so there's that.

Reply via email to