On Saturday, 2 September 2017 at 17:00:46 UTC, Joakim wrote:
Sorry, I assumed the D version worked fine and didn't bother to
check the output, turns out it needs two foreach loops changed
in advance(dt). Specifically, "Body i" should be changed to
"ref Body i" in both foreach statements, so the data is
actually updated. ;)
After that change, the C++ version wins by a little, 6 seconds
vs. 6.5 seconds for the D translation. I see that the C++
version directly invokes SIMD intrinsics, so perhaps that's to
be expected.
W.r.t. to the impact of the languages on code base
maintainability, etc. I would consider D the better choice either
way :)
(However the domain you are acting in is guiding a decision for
or against a programming language to a great extend: available
frameworks, development tools, etc.)