3 ms·
I had the misfortune of porting about 100kloc of Matlab (aggregated by a bunch of non-coding types) into Julia (this was back in the v0.5 days) and then two yea
by thebooktocome 4y ago
I had the misfortune of porting about 100kloc of Matlab (aggregated by a bunch of non-coding types) into Julia (this was back in the v0.5 days) and then two years later porting the whole ~75kloc of Julia (plus a couple mods made in the intervening time) back into Matlab.
The first thing I did before porting a feature was write a unit test on either side (because of course the Matlab side came with the most arbitrary test coverage you've ever seen). Then it was off to mexing Julia through the terrible C FFI in order to pretend to do validation. (In practice, this was not as helpful as it could have been, since I couldn't figure out how to make Julia and Matlab agree on a floating-point environment and Julia back then had some well-known correctness problems with its math library (that have been fixed by now, afaik)).
Other than that, the whole experience was pretty chaotic and terrible, would not advise doing again.
- andrewf 4y agoI once ported a small amount of code from C to a managed language. The C code used single precision floats (24 bit significand), the target language supported only double precision (53 bit significand). There was little enough math that it was practical to do something like frob = x * 2 ** (53-24); x += frob; x -= frob; to truncate the extra bits and produce the same result, for easier verification.