Perhaps the best thing is that existing Mathematica packages run incredibly well in the new version of Mathematica, much faster and with awesome graphics!
Interesting, having tidied up the C++ code, this OCaml code is still less than half the length. The original OCaml clearly had several unused functions, several pointless reimplementations of the library functions and many comments regarding Haskell (?!).
In terms of performance, I get:
$./garden2 real 0m16.951s user 0m16.870s sys 0m0.010s
$./Garden real 0m10.200s user 0m10.160s sys 0m0.010s
So OCaml wins on performance per LOC.:-)
However, this C++ is also very poorly written IMHO. Specifically, it should use the STL and, particularly, vector<bool> to implement bitmaps. That would be a better contender...
Perhaps the best thing is that existing Mathematica packages run incredibly well in the new version of Mathematica, much faster and with awesome graphics!
Interesting, having tidied up the C++ code, this OCaml code is still less than half the length. The original OCaml clearly had several unused functions, several pointless reimplementations of the library functions and many comments regarding Haskell (?!).
./garden2
./Garden
:-)
In terms of performance, I get:
$
real 0m16.951s
user 0m16.870s
sys 0m0.010s
$
real 0m10.200s
user 0m10.160s
sys 0m0.010s
So OCaml wins on performance per LOC.
However, this C++ is also very poorly written IMHO. Specifically, it should use the STL and, particularly, vector<bool> to implement bitmaps. That would be a better contender...