3 ms·
Nim has extremely low compilation times...order 200 millisec with the TinyCC/tcc backend and order 800 millisec with gcc (both for the zero length empty module)
by cb321 5y ago
Nim has extremely low compilation times...order 200 millisec with the TinyCC/tcc backend and order 800 millisec with gcc (both for the zero length empty module). Less trivial projects (say transitively importing 25 modules) are more like 1.2 seconds and 5..6 seconds. All of these numbers are about to improve quite a bit with incremental compilation which is under active development, but they are already quite friendly/fast code-test-code again cycles.
You can even write a "script" by putting "#!/usr/bin/nim r" at the top of your file (like #/bin/sh) and making it executable. (With nim r the compilation will be cached and so not require much time at all.) I would not call Nim a scripting language as typically understood (e.g. with 100 usec to 15 msec startups), but both compile|use cached & run makes it more similar than most alternatives. pypy3 on an empty file on the same machine as the above timings takes 40 ms, for example.
There is also a mode called "nim script" where rather than running an external C/C++/nodejs compiler a restricted subset can be compiled and run right on the same VM Nim uses for its Lisp-like macro facility. That only takes about 100 ms, but the savings relative to 200..250 ms with no subset restrictions may not be very compelling.
TL;DR is that Nim gives you a lot of options. In this and in most things, really (memory management, code style, etc., etc.).