Port a benchmark to D?

bearophile bearophileHUGS at lycos.com
Fri Jun 3 13:24:10 PDT 2011


Timon Gehr:

> have you already noticed how incredibly stupid some parts of the implementation of cpp are?

Some of those "stupid" things come from the very strict Google C++ coding standards.

Even if my C++ experience is not extensive, I find this C++ easy to understand.

One part of the code:

      }  // node_pool.size
    }  // Step c
  }  // FindLoops

 private:
  MaoCFG             *CFG_;      // current control flow graph.
  LoopStructureGraph *lsg_;      // loop forest.
};  // HavlakLoopFinder


The Ada language has a syntax to write those names at the closing ends, and the Ada compiler enforces such names to be always coherent and correct. In C/C++/D unfortunately such names (written as comments) may go out of sync. Despite this risk I add similar comments at the end of functions/classe/structs/loops in my D code too, because the risk of them getting out of sync is lower than the advantages they give me. I have not written an enhancement request yet about this in the D Bugzilla yet, also because I don't know what a good C-style syntax for it could be.

Bye,
bearophile


More information about the Digitalmars-d mailing list