top | item 31930705

(no title)

nimmer | 3 years ago

It's much faster than C++, Rust, Go and many others.

discuss

order

zimpenfish|3 years ago

I'm assuming this must be for huge projects?

I just compiled my toy project (detecting anomalous parity in integers) in nim 1.6.6 (4.23s), go 1.17.7 (2.43s to create both aarch64 and x86_64 binaries), zig 0.8.0-dev.1140 (2.04s to create aarch64 and x86_64 binaries) and C via clang 13.1.6 (0.14s).

nim's compilation is 175% of Go, 207% of zig, and 3021% of clang.

machinekob|3 years ago

how are u compiling (optimization, custom compilation flags etc.?) In my case https://github.com/mratsim/Arraymancer big project compile under your 4.2s so or you have like 10k+ lines of codes with macros or you just pass some debug flags to compiler :D

nimmer|3 years ago

No, even small files. You must have issues with your setup. Are you sure your compiler is not built in debug mode?

Rochus|3 years ago

Thanks for the data; that's what I call an elegant rebuttal.

hahaitsfunny|3 years ago

No, it is not - Nim's compiler backend is extremely complex and full of cruft. I've been around Nim for 7+ years now and there's a reason the compiler was hard forked.

Nim's compiler is definitely not speedy, and this is why so much effort has been spent on incremental compilation, which tmk, still isn't working - https://github.com/nim-lang/Nim/issues/19757.