From: Robert W. B. <rb...@di...> - 2001-06-22 21:31:27
|
<moved to jython-users> Hello Nabil, It may be worth your while to rummage through the goodies at http://www.jython.org/docs. The wording of your questions might imply a misunderstanding about Jython (or on my part), so it would be good to get a feel from the current docs. The summary is Jython allows you to import and use Java classes from the classpath (and sys.path) within the python language syntax. It also allows Jython classes that meet certain restrictions to be compiled and work in Java as if they were native Java classes. It is a comprehensive integration of Java a Python into a programming language and is likely better understood if approached in this context. Specific replies appear below... On Fri, 22 Jun 2001, Nabil Obeid wrote: > I want to use a java python translator Using "translator" might be a bit odd. Jython is a full and legitimate implementation of a language defined in the Python language definition. It could be just me, but "translater" implies something different. > but before I would like > get informed about few issues. I would be grateful to have answer > for these questions ASAP. > > - Does jyhton provide a source only bridge or can it > use .jar and .class hierarchies ? Jython can load java classes from jars or directories. > - What is the runtime overhead associated passing > between Java and Python ? Is some overhead present > even when data is not passed between both of them ? Jython's performance is on par with other high-level, object-oriented languages. "Passing" specifically seems odd to single out because of the level of integration between Java and Python. memory overhead for Java objects wrapped in Jython is ~8-16 additional bytes depending on object and jvm (Finn Bock has sent better info concerning this to the jython-users mailing list- try searching the archives on "large data set finn bock"). > - Can we have native methods written in Python for > Java classes ? You can write a Jython class, compile it and use it from Java (if it meets requirements described at http://www.jython.org/docs/jythonc.html look for info on @sig strings and Java superclasses). You can also use an embedded Jython interpreter so that Java methods may employ the interpreter object. > - How is Java called from Python ? >>> import java # it's now accessible > - What's the memory footprint for the system ? Left for others... > - Can python debugger access Java instances and > classes? No > - Are there any limits restricting the use of > jython ? How about platforms ? Jython works where there is a fully compatible jvm >= 1.1. > - What are the limits imposed by the semantic > differences of Java and Python ? A team of thousands of experts across the globe were joined together and commissioned to discover any such limitations to Jython, but nobody has yet to hear from them :) Seriously now... The information you want is likely in the details of using Jython and would be too difficult to wrap in a generalized answer. For the broad topic "will Jython limit my application or ability to develop an application?" the answer is no more than Java would. Common generalizations about the Python language are that you trade some run-time speed for development speed, you trade compile-time type/protocol checking for flexibility, and you trade semi-colons and braces for indention. There really is more to it though, it's just an accumulation of subtle things that are hard to abbreviate in an email. Best of luck, Robert |