<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Round Rock River: Automated Translation of Java to Python</title>
    <link>http://blog.melhase.net/articles/2007/02/15/automated-translation-of-java-to-python</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>enough water makes all rocks round</description>
    <item>
      <title>Automated Translation of Java to Python</title>
      <description>&lt;p&gt;I've written a tool to automatically translate Java source code
to Python source code.  The tool is useful, and it's already
working for me as I intended.  It's called
&lt;a href="http://code.google.com/p/java2python/"&gt;java2python&lt;/a&gt; (clever,
no?) and you can download it
&lt;a href="http://code.google.com/p/java2python/downloads/list"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let me back up a bit and explain the motivation behind this.  I'm
the author and sole maintainer of the Python port of the
&lt;a href="http://www.interactivebrokers.com/"&gt;Interactive Brokers&lt;/a&gt; API
(&lt;a href="http://ibpy.melhase.net/"&gt;IbPy&lt;/a&gt;).  IB provides a
default/reference Java implementation for UNIX and MacOS.  This
reference implementation is straight forward: it contains a
Thread subclass that reads from a socket, an associated class for
writing to the socket, plus a few other support classes.
Conceptually pretty simple, and the initial port was actually
easy (once I figured out the difference between writing data to a
socket in Java and writing data to a socket in Python).&lt;/p&gt;</description>
      <pubDate>Thu, 15 Feb 2007 02:58:48 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:c892acf2-40a6-420b-ad93-8e2d4bbbf864</guid>
      <author>troy</author>
      <link>http://blog.melhase.net/articles/2007/02/15/automated-translation-of-java-to-python</link>
      <category>python</category>
    </item>
    <item>
      <title>"Automated Translation of Java to Python" by Don</title>
      <description>&lt;p&gt;Troy:&lt;/p&gt;

&lt;p&gt;'what did you have in mind? do you need to translate a java library without intervention?'&lt;/p&gt;

&lt;p&gt;None in particular.  I just briefly fantasized about being able to use any Java library from Python without using Jython.&lt;/p&gt;</description>
      <pubDate>Wed, 21 Feb 2007 03:40:16 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:ff47d17a-f34f-4a44-8405-8abab193caa9</guid>
      <link>http://blog.melhase.net/articles/2007/02/15/automated-translation-of-java-to-python#comment-19</link>
    </item>
    <item>
      <title>"Automated Translation of Java to Python" by Mike</title>
      <description>&lt;p&gt;Seems the python2java translation could possibly be done with some of the cool stuff the folks at PyPy are doing with type inference and how they translate to C or CLI.  Maybe one could have a backend to java code.  Just a thought.&lt;/p&gt;</description>
      <pubDate>Tue, 20 Feb 2007 07:44:10 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:e0b2cbe4-ec03-4870-b06c-fd8dd1696a54</guid>
      <link>http://blog.melhase.net/articles/2007/02/15/automated-translation-of-java-to-python#comment-18</link>
    </item>
    <item>
      <title>"Automated Translation of Java to Python" by troy</title>
      <description>&lt;p&gt;Don,&lt;/p&gt;

&lt;p&gt;i don't think that complex translations could be totally automated -- not without a lot more work on the translator.&lt;/p&gt;

&lt;p&gt;but i'm not really after lexical analysis; the tool is working for me exactly like i need it to work.  there's support for mapping java types to python types, there's support for changing some common java statements into the equivalent python.  most important to me, there's support for per-file imports and per-file regex substitutions applied to the output.&lt;/p&gt;

&lt;p&gt;what did you have in mind?  do you need to translate a java library without intervention?&lt;/p&gt;</description>
      <pubDate>Mon, 19 Feb 2007 10:03:16 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:482588aa-e55f-4dca-b1de-c2274e52c3c7</guid>
      <link>http://blog.melhase.net/articles/2007/02/15/automated-translation-of-java-to-python#comment-17</link>
    </item>
    <item>
      <title>"Automated Translation of Java to Python" by Don</title>
      <description>&lt;p&gt;How far do you think you can go with this?  &lt;/p&gt;

&lt;p&gt;Do you think it might be possible to convert any Java library to Python with little or no manual intervention? &lt;/p&gt;</description>
      <pubDate>Mon, 19 Feb 2007 04:15:50 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:a5e4a27d-9cfb-4474-8cbe-f7502bca2b08</guid>
      <link>http://blog.melhase.net/articles/2007/02/15/automated-translation-of-java-to-python#comment-16</link>
    </item>
    <item>
      <title>"Automated Translation of Java to Python" by jml</title>
      <description>&lt;p&gt;Pretty neat. Python is sort of a superset of Java so it seems like it should translate reasonably well. I wonder how it'll handle integer overflow.&lt;/p&gt;</description>
      <pubDate>Thu, 15 Feb 2007 23:07:35 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:75e001c9-eda0-48dc-806f-46b28b868f0b</guid>
      <link>http://blog.melhase.net/articles/2007/02/15/automated-translation-of-java-to-python#comment-15</link>
    </item>
    <item>
      <title>"Automated Translation of Java to Python" by Skip Montanaro</title>
      <description>&lt;p&gt;Given Python's runtime typing, direct conversion of Python source to Java source would be difficult if not impossible.  Given the available of Jython, why bother anyway?&lt;/p&gt;</description>
      <pubDate>Thu, 15 Feb 2007 18:14:47 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:d255fc7d-a40b-499a-b94b-1a2493e89271</guid>
      <link>http://blog.melhase.net/articles/2007/02/15/automated-translation-of-java-to-python#comment-14</link>
    </item>
    <item>
      <title>"Automated Translation of Java to Python" by Ian Ozsvald</title>
      <description>&lt;p&gt;A video tutorial of python2java might be quite neat, especially to show interested users just how easy it is to get going.  If anyone is interested in the idea, I'd help to make the video and we'd host it for free (and the tools are open-source) over at ShowMeDo.
Just throwing this in as an idea for some extra publicity for you :-)
Regards,
Ian Ozsvald (co-founder showmedo.com)&lt;/p&gt;</description>
      <pubDate>Thu, 15 Feb 2007 15:24:01 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:280b7f40-0dd6-416a-b239-c2966afc6a4f</guid>
      <link>http://blog.melhase.net/articles/2007/02/15/automated-translation-of-java-to-python#comment-13</link>
    </item>
    <item>
      <title>"Automated Translation of Java to Python" by troy</title>
      <description>&lt;p&gt;no plans for python2java.  i don't need such a thing, and i'm not sure it would even be possible.  if you're inclined to write it, please keep me posted!&lt;/p&gt;</description>
      <pubDate>Thu, 15 Feb 2007 10:04:58 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:65ee3c0a-aae5-439c-ac5c-7318decc1f15</guid>
      <link>http://blog.melhase.net/articles/2007/02/15/automated-translation-of-java-to-python#comment-12</link>
    </item>
    <item>
      <title>"Automated Translation of Java to Python" by Demetrios Kyriakys</title>
      <description>&lt;p&gt;Any plans to make a Python2Java equivalent?&lt;/p&gt;

&lt;p&gt;I think that having the translation in both directions, would increase the corectness and testability of each version, and about the "visibility" of the project not to mention :).&lt;/p&gt;

&lt;p&gt;Thank you,&lt;/p&gt;

&lt;p&gt;D.&lt;/p&gt;</description>
      <pubDate>Thu, 15 Feb 2007 07:08:46 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:4615323d-48c5-4f27-a58f-fb617a9c2651</guid>
      <link>http://blog.melhase.net/articles/2007/02/15/automated-translation-of-java-to-python#comment-5</link>
    </item>
  </channel>
</rss>
