Java to Python translation

Alex Martelli aleax at aleax.it
Thu Apr 4 05:05:05 EST 2002


Frithiof Andreas Jensen wrote:
        ...
> If you really are not convinced, then run a Fortran program through f2c on
> a Linux box and gaze upon the resulting C code. Then try and modify that.

That's basically what I did many years ago to move cad.lab's main code
base from Fortran to C -- except that it was on Ultrix (one of Digital's
attempts at Unix:-), not Linux, and that of course I heavily hacked f2c
to suit our specific needs, the specific idioms we used, and so on.  The
result was quite good; substantial amounts of that code, both parts
that were later heavily modified and ones that didn't need to be, were
still in production when I left the firm (renamed in the meantime to
think3 -- www.think3.com) two months ago.  I still shudder to think how
much of the then-new-and-exciting language Perl I used to write various
auxiliary scripts for pre-processing and post-processing tasks...:-).

But the roughly 6 months it took me (with about 3 months' worth of help
from each of 3 other colleagues) still vastly beat the alternative of
recoding _every_thing (part of the push was porting to a platform that
lacked any real Fortran compiler).  At about 1 million lines of code,
roughly 10,000 function points, an optimistic estimate for recoding it
all would have been 5 man-years (at 1000 loc/day and 200 days/year),
while this way it took us little more than 1 man-year.

If I hadn't had f2c or something like it to start with, of course,
then the project would not even have begun (we also considered some
commercial alternatives, but f2c's open-source nature was a must to
enable me to perform the many necessary hacks).  I don't know of
anything equivalent for java->python migration.  But I couldn't let
this aspersion on f2c stand unchallenged...!-)



Alex




More information about the Python-list mailing list