Why Nim
Nim compiles to C (or C++/JS) and claims C-like performance with Python-like syntax. It has a small but passionate community that frequently cites performance as a key selling point — benchmarking it would either validate or challenge those claims against actual C/C++ results.
Key considerations
- Compiles to C by default, then compiled with gcc/clang — similar pipeline to Cython
- GC by default (ARC/ORC), but deterministic — different tradeoffs than Go/Java
- Python-influenced syntax with significant whitespace
nim compile --run for development, nim compile -d:release for optimized builds
- Benchmark should use
-d:release to be fair (like Rust uses --release)
Implementation
Implement all 7 benchmark algorithms following the reference implementations (PHP, C++, Python):
Setup:
Why Nim
Nim compiles to C (or C++/JS) and claims C-like performance with Python-like syntax. It has a small but passionate community that frequently cites performance as a key selling point — benchmarking it would either validate or challenge those claims against actual C/C++ results.
Key considerations
nim compile --runfor development,nim compile -d:releasefor optimized builds-d:releaseto be fair (like Rust uses--release)Implementation
Implement all 7 benchmark algorithms following the reference implementations (PHP, C++, Python):
Setup:
langs/nim/benchmark.ymldocker/nim/Dockerfile