C/C++, Perl, etc. to Python converter

John Nagle nagle at animats.com
Thu Jan 4 03:06:48 EST 2007


Diez B. Roggisch wrote:
> 
>>
>> I think that it *is* possible to do it, but a whole lot of work had to
>> be done to achieve this. It is all about how many rules (like how to
>> convert this block of unreadable code of language X into a readable
>> python block) you are willing to find/program (and these are a lot). It
>> is a almost gigantic task to make this work proper, but it definitely
>> *is* possible.
> 
> 
> It is definitely _not_ possible. There are so many design decisions that 
> are differing based on what a language offers - e.g. generators, garbage 
> collection, precise control over memory layout and so on.

    Inter-language translators have been written.  There's usually
a performance penalty, which can be severe when the idioms of
the languages are quite different.

    Perl to Python translation might be worth doing.  The
languages have quite different syntax, but roughly the same
functionality.  You'd probably have to write a set of libraries
in Python with the equivalent definitions to their Perl
counterparts, but that's just time-consuming, not difficult.

				John Nagle



More information about the Python-list mailing list