Re: Java to Python tranlation

torbenm@app-7.diku.dk (Torben =?iso-8859-1?Q?=C6gidius?= Mogensen)
6 Feb 2007 16:06:56 -0500

          From comp.compilers

Related articles
Java to Python tranlation d.micaletto@network.it (root) (2007-02-05)
Re: Java to Python tranlation torbenm@app-7.diku.dk (2007-02-06)
Re: Java to Python tranlation bbrown@speakeasy.net (Robert Brown) (2007-02-16)
| List of all articles for this month |
From: torbenm@app-7.diku.dk (Torben =?iso-8859-1?Q?=C6gidius?= Mogensen)
Newsgroups: comp.compilers
Date: 6 Feb 2007 16:06:56 -0500
Organization: Department of Computer Science, University of Copenhagen
References: 07-02-013
Keywords: translator
Posted-Date: 06 Feb 2007 16:06:55 EST

root <d.micaletto@network.it> writes:


> I'm interested to the complementar problem:
> from Python to Java translation.


One major problem going this way is that Python is dynamically typed
where Java is statically typed. This means that you will need to
check for correct types at every operation instead of at compile time.


One way that might work is to let every variable be of type Object and
downcast before every operation. Numbers and other values that are
not objects in Java would have to be boxed as objects and values
extracted from the objects before operating on them, then finally
boxing the result.


Torben


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.