3 ms·
It certainly has for me. Here is me translating as literally as I could a bit of nontrivial code (which I originally learned from R's C code): http://inverset
by jordigh 11y ago
It certainly has for me.
Here is me translating as literally as I could a bit of nontrivial code (which I originally learned from R's C code):
http://inversethought.com/hg/medcouple/file/default/jmedcouple.c++ http://inversethought.com/hg/medcouple/file/default/jmedcoup...
http://inversethought.com/hg/medcouple/file/default/medcouple.py http://inversethought.com/hg/medcouple/file/default/medcoupl...
I'm really happy how almost every Python statement has a nearly equivalent C++ statement. The only one I had trouble with was list comprehensions, but they can be very nearly translated with C++ stdlib algorithms and a few lambdas (kind of looks more like map and filter than a list comprehension, though).
The best part is that the C++ code runs as fast and sometimes faster than the original C code I grabbed this from! (The translation path was C -> Python -> C++.)