[Tutor] RE: [Jython-users] Python to native compilation via java?

Danny Ayers danny.ayers@btinternet.com
Mon, 18 Jun 2001 23:45:06 +0100


I've just been looking at some of the intermediate Java code generated by
jythonc on its way to a .class. I may be wrong, but it looks to me like the
class is will effectively wrap up the python source, which will be
interpreted by the interpreter embedded in jpython. To compile this up to
native code, unless the compiler is *really* smart it would carry over all
the inefficiencies of the interpretation process, and so I would guess that
the performance improvements overall are likely to be minimal or
non-existent, compared to running the Python source on a native interpreter.
I guess.

BTW, I've just been trying to find a good way of porting Python source over
to Java, and made a small step forward using the Object Domain UML tool
(time limited demo) - it can generate the Java classes and method shells
(from UML generated from Python), which with a bit of search & replace (get
rid of 'self'!) should save a fair bit of hand coding.

---
Danny Ayers
http://www.isacat.net

>-----Original Message-----
>From: jython-users-admin@lists.sourceforge.net
>[mailto:jython-users-admin@lists.sourceforge.net]On Behalf Of VanL
>Sent: 18 June 2001 21:21
>To: jython-users@lists.sourceforge.net
>Subject: [Jython-users] Python to native compilation via java?
>
>
>Hello,
>
>(Cross-posted by request from the python-tutor mailing list)
>
>I was reading about the new gcc 3.0 release, and something that caught
>my eye:
>
>"""
>The GNU Compiler for the Java Programming Language
>What is GCJ?
>
>GCJ is a portable, optimizing, ahead-of-time compiler for the Java
>Programming Language. It can compile:
>
>    * Java source code directly to native machine code,
>    * Java source code to Java bytecode (class files),
>    * and Java bytecode to native machine code.
>
>Compiled applications are linked with the GCJ runtime, libgcj, which
>provides the core class libraries, a garbage collector, and a bytecode
>interpreter. libgcj can dynamically load and interpret class files,
>resulting in mixed compiled/interpreted applications.
>"""
>
>Would code get any significant speedup by going jython -> .class files
>-> native? Is it possible?  And does jython compile under gcj?
>
>Thanks,
>
>Van
>
>
>
>_______________________________________________
>Jython-users mailing list
>Jython-users@lists.sourceforge.net
>http://lists.sourceforge.net/lists/listinfo/jython-users