Java to Python translation

Martin v. Löwis loewis at informatik.hu-berlin.de
Wed Apr 3 12:07:36 EST 2002


vio <vmilitaru at sympatico.ca> writes:

> From a technical point of view, I don't see anything magical or
> impossible about a java2python tool. I am aware of at least a
> software product that does it, but it's a commercial offering. This
> comercial tool's existance is proof of technical feasibility. I also
> have coded myself an early java2py translator, in python. But it was
> cheezy, and implements only a fraction of the java grammar.  I'm not
> a java programmer, and I do not want to spend much time to learn it
> either (again!) to create rules for the translation.

Translating the source code on a statement-by-statement basis might
indeed be possible. However, the resulting Python program will hardly
work, as you need all the Java libraries that it uses. Furthermore,
naive translation may lose semantic information: e.g. you have
overloading in Java but not in Python. So information which operation
to call can easily be lost during translation.

Regards,
Martin




More information about the Python-list mailing list