Does this really run ? I see a semicolon in your link to the Nim source:
I was really happy trying Nim, and as a result the Nim code is a bit more optimized and engineered:
It has some optimizations: I don't compute 1M samples for each dist, but instead pass functions around and compute the 1M samples at the end
Without 1. and 2., the nim code takes 0m0.183s instead. But I don't think that these are unfair advantages: I liked trying out nim and therefore put in more love into the code, and this seems like it could be a recurring factor.
You should somewhat compare apple-to-apple. Otherwise it doesn't make sense for Nim floating point code to be 5x faster than C.
"Lines of code" is rather meaningless given that it could easily be fewer lines of code.
I mean, it's a rough proxy of the complexity of the code which I actually produced. Not perfect, but I think defensible.
apple-to-apple
Yeah, but apple-to-apple vs what? Apple to apple in terms of the same algorithm, or in temrs of effort spent? With the same effort spent, nim would have better algorithms...
apple-to-apple
Yeah, but apple-to-apple vs what? Apple to apple in terms of the same algorithm, or in temrs of effort spent? With the same effort spent, nim would have better algorithms...