2 ms·
> stopped using C++ because [...] and the overhead of headers adds too much to compile time? > An enormous draw for alternatives, like Rust, Zig, Nim et al is
by jlokier 5y ago
> stopped using C++ because [...] and the overhead of headers adds too much to compile time?
> An enormous draw for alternatives, like Rust, Zig, Nim et al is that they simply don't have these problems.
I'm using Nim full time at the moment in a large project.
Like Rust, it certainly does have the compile time problem due to parsing lots of files! Every compile, Nim processes every source file in the program, including libraries, and this can take minutes.
Unlike C++ where each source file can be compiled in parallel, and after a small change most files usually don't need to be recompiled, Nim's scan of the whole program's source files is single-threaded, so it's the slowest part of the build. Nim compiles to C, and the C compilation and linking steps are relatively fast because the C compilations are run in parallel and cached.