As I understand, "nim r prg.nim" does the following: it compiles a program if necessary and then it launches the binary. However, if the binary is in the cache and the source hasn't changed, it simply launches the binary.
However, when it simply launches the binary, it happens quite slowly. Let's take a simple "hello world" example:
$ time nim r hello.nim
667 msec (compile time + launch)
$ time nim r hello.nim
106 msec (nothing changed, thus no compilation, just launch)
$ nim c hello.nim
$ time ./hello
5 msec
Why is "nim r hello.nim" 20x slower when it just needs to launch the cached binary (2nd case)?