From: D-Man <ds...@ri...> - 2001-02-07 19:00:42
|
I don't have a diagram, but maybe an explanation will help: Jython is a collection of Java classes that work together. This collection of classes (found in jython.jar) can be used in several ways : as an interactive console, an interpreter for python code, and a library that Java classes can use . Since jython is written in Java, it requires a JVM to run. I think the 3 most common ways of using jython are as a python interpreter that can be run on any system with a working JVM, a bridge that allows an application to be written as a combination of Python and Java code, or as an embedded interpreter that will allow your Java application to be extended/customized by users via python code. If you simply use it as a python interpreter, you will not see much difference between CPython and Jython. The main difference is that CPython has several C libraries/extension modules you can access from the Python code and Jython can access any Java library. If you use it to combine Python and Java sources in a single application you will find that Jython allows your python code to access any Java objects and work with them as if they were Python objects. With a certain amount of care, your java code will be able to work with Python objects as if they are Java objects. (The care is that Python can do things that Java can't, and vice versa -- think of free standing functions or static data/methods) When you use jythonc, your python code in parsed, and then some Java code is generated. The generated Java code is little more than a class that makes method calls into the Jython interpreter/library to accomplish what you coded. It can also generate methods whose signatures match what a Java class would expect so that Java code can call the methods without realizing that the class was written in Python. In the simplest view, Jython is just a Java library written in Java that runs in a JVM. HTH, -D On Tue, Feb 06, 2001 at 11:06:26AM -0700, Mats Wichmann wrote: | | I'm looking for a nice illustrative diagram of what Jython | "does" - in other words, how this piece works together with | a "normal" Java environment. | | I've a simplified Java sketch that goes like this | (rendered very roughly into text form): | | | Application: | [[ .java sources ]] ==> (( javac compiler )) ==> [[ .class files ]] | || | || | Java Libraries: [[ java classes: .jar files ]] <==> (( JVM )) | || | || | Native Operating System | | | How would I fold Jython, and Jythonc, into the same | simplified terms (without getting wildly inaccurate): | | | Or even better - does anyone know of an existing diagram | that would make my efforts redundant? | | Thanks, | | Mats |