To get small executables with Nim you may try
nim c -d:danger --gc:arc -d:useMalloc -flto myprog.nim
RunIm best case use also gcc10, it can generate smaller binaries than gcc9 with -flto. (It shrinks my chess game to 105k.) Also there was a tutorial by Mr Felsing about shrinking, and maybe you should watch the last PMunch talk also.
