Skip to content

Explore adding Nim #138

@leon0399

Description

@leon0399

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):

  • collatz/MaxSequence
  • linpack/Linpack
  • mandelbrot/Simple
  • primes/Atkin
  • primes/Simple
  • recursion/Tak
  • treap/Naive

Setup:

  • Create langs/nim/benchmark.yml
  • Create docker/nim/Dockerfile
  • Update README.md implementation table

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions