Java to Python autoconverters

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Java to Python autoconverters

Sebastian M Cheung
Are these available? Any good ones to recommend?

Reply | Threaded
Open this post in threaded view
|

Java to Python autoconverters

Stefan Behnel-3
Sebastian M Cheung via Python-list schrieb am 12.06.2015 um 13:36:
> Are these available? Any good ones to recommend?

I recommend not doing that. You'd end up with ugly and unidiomatic Python
code that's impossible to maintain, whereas you now (hopefully) have
somewhat idiomatic Java code that should be reasonably maintainable.

If you want to integrate Python code with Java code, take a look at Jython
instead. If that's not what you want, then feel free to unveil your intentions.

Stefan



Reply | Threaded
Open this post in threaded view
|

Java to Python autoconverters

Mark Lawrence
In reply to this post by Sebastian M Cheung
On 12/06/2015 12:36, Sebastian M Cheung via Python-list wrote:
> Are these available? Any good ones to recommend?
>

Yes and no.

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence


Reply | Threaded
Open this post in threaded view
|

Java to Python autoconverters

Ian Kelly-2
In reply to this post by Stefan Behnel-3
On Jun 12, 2015 6:53 AM, "Stefan Behnel" <stefan_ml at behnel.de> wrote:

>
> Sebastian M Cheung via Python-list schrieb am 12.06.2015 um 13:36:
> > Are these available? Any good ones to recommend?
>
> I recommend not doing that. You'd end up with ugly and unidiomatic Python
> code that's impossible to maintain, whereas you now (hopefully) have
> somewhat idiomatic Java code that should be reasonably maintainable.
>
> If you want to integrate Python code with Java code, take a look at Jython
> instead. If that's not what you want, then feel free to unveil your
intentions.

I've also found Jpype useful in the past, allowing integration between
CPython and a JVM. I'm not sure if it's actively maintained, though.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150612/2edfa667/attachment.html>

Reply | Threaded
Open this post in threaded view
|

Java to Python autoconverters

Michael Torrie
In reply to this post by Sebastian M Cheung
On 06/12/2015 05:36 AM, Sebastian M Cheung via Python-list wrote:
> Are these available? Any good ones to recommend?

The only use case for such a program that I can think of is a compiler
that is just using another language as an intermediate step, and that
language is usually going to be compiled (for example, several compilers
for different languages emit C code) or some other virtual machine like
a Javascript engine.

I don't want to put this too harshly, but the job of translating from
one language to another, and making the code idiomatic and maintainable
is up to you the programmer.  If you are a programmer you should be able
to easily do this, even if you have not worked with the source language
before.