CPython vs. Jython/JPython
D-Man
dsh8290 at rit.edu
Mon Oct 30 23:16:24 EST 2000
Ok, if viewing python as a glue language, then the 2 different implementations of the interpreter is reasonable. I was viewing python as a standalone application language.
Thanks for the response.
-D
BTW, the question wasn't why didn't the same people make both interpreters, but why effort was duplicated in making 2 interpreters
On Mon, 30 Oct 2000 21:32:08 Guido van Rossum wrote:
> You are all wrong. :-)
>
> The key difference between CPython and JPython is not speed, but
> available extensions. CPython is useful as a glue language for C/C++
> library code. There are lots of examples, e.g. NumPy, Tkinter, PIL,
> and so on. JPython is useful as a glue language for Java library
> code, e.g. Swing, JavaBeans, Jave 2 Enterprise Edition APIs, and so
> on.
>
> If only CPython existed, linking to Java code would be very
> cumbersome: you'd have to wrap a JVM in a CPython extension and take
> it from there. If only JPython existed, linking to C/C++ code would
> be impossible (in situations where JNI is not available) or at best
> cumbersome (wrapping C/C++ code in JNI is much more painful than
> writing Python wrappers, because of the JVM's garbage collector).
>
> It's sometimes possible to use C/C++ code from JPython (e.g. Finn Bock
> did a wrapper for _tkinter) but rarely convenient. I haven't heard of
> anyone linking to a JVM from CPython.
>
> Of course, the fact that there are two different implementations means
> that an app that requires the use of both a library written in C/C++
> and one written in Java is out of luck. Fortunately, most of the
> standard extensions (e.g. regular expressions) are available in both
> CPython and JPython.
>
> In the rare case where you need two non-standard extensions, you could
> write your program as two communicating processes, one using JPython,
> one using CPython.
>
> --Guido van Rossum (home page: http://www.python.org/~guido/)
> --
> http://www.python.org/mailman/listinfo/python-list
>
More information about the Python-list
mailing list