Skip to content

Explore adding D #140

Description

@leon0399

Why D

D was designed as a "better C++" — it keeps C-compatible performance while adding GC, modules, and modern features. It occupies a unique space between systems languages (C, C++, Rust) and managed languages (Java, Go). Benchmarking it would show whether the GC overhead is measurable in compute-heavy workloads.

Key considerations

  • GC by default but supports manual memory management via @nogc
  • Benchmark should use default GC mode for fairness (like Go)
  • Three compilers: DMD (reference, fast compile), LDC (LLVM backend, faster output), GDC (GCC backend)
  • LDC is the recommended compiler for performance benchmarks
  • ldc2 -O -release for optimized builds
  • C-like syntax — implementations should be straightforward ports from C++

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/d/benchmark.yml
  • Create docker/d/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