Why Crystal
Crystal has Ruby-like syntax but compiles to native code via LLVM. Since Ruby is already in the benchmark suite (with CRuby, JIT, and JRuby variants), Crystal would provide a direct and likely dramatic comparison — same familiar syntax, radically different runtime characteristics.
Key considerations
- Compiles to native code via LLVM — expect performance closer to Go/Rust than Ruby
- Ruby-inspired syntax — implementations can closely mirror existing Ruby code
- Static typing with type inference (no type annotations needed in most cases)
crystal build --release for optimized builds
- Null safety built into the type system — may require minor adaptations for treap
Implementation
Implement all 7 benchmark algorithms following the reference implementations (PHP, C++, Python):
Setup:
Why Crystal
Crystal has Ruby-like syntax but compiles to native code via LLVM. Since Ruby is already in the benchmark suite (with CRuby, JIT, and JRuby variants), Crystal would provide a direct and likely dramatic comparison — same familiar syntax, radically different runtime characteristics.
Key considerations
crystal build --releasefor optimized buildsImplementation
Implement all 7 benchmark algorithms following the reference implementations (PHP, C++, Python):
Setup:
langs/crystal/benchmark.ymldocker/crystal/Dockerfile