Dynamically-typed languages can be fast when run with a jit -- for example, Lua+luajit is close to Go in your microbenchmark. On my computer, for n=40, Go is 0m2.156s and luajit is 0m3.199s.
PyPy uses JIT to improve Python run time speeds but it's still magnitudes slower than statically typed languages.
I've upped n to 40 and rerun with the following languages:
C: 0.38s
Java: 0.55s
Go: 0.90s
Rust: 1.29s
LuaJit: 2.19s
Haskell: 8.97s
PyPy: 10.06s
Lua: 22.87s
Ruby: 22.13s
Python2: 43.88s
Python3: 66.28s
All code is available in the previous mentioned gist:But anyway, in my (limited) experimentations with LuaJIT, it's often been within a factor of 2x-3x of speed of C, which to me is pretty fast, and typical of many statically-typed, compiled languages.