From: Silvio A. <sar...@mo...> - 2001-09-03 13:31:08
|
Hello everybody, I'm preparing a presentation to show the work I did in Jython and CPython to the rest of my team (most of them don't know anything about Python), and explain them what we can do with this powerful "new stuff". Among the other things, I should explain why in Jython we can import directly the Java packages while in CPython we have to deal with creating extension modules. I am going to simplify things like this (please someone tell me if I'm wrong!): Jython translates Python objects, exceptions and threads to real Java ones. So the logic for the run-time handling of objects (including memory allocation, for example), exceptions and threads is all in the JVM, the Jython interpreter behaves more or less like an interface. This allows the seamless integration, since other programs of the Java platform are running over the same JVM. CPython interpreter is coded in C, and relies directly on the OS. The logic for run-time handling of objects and exceptions, and for handling threads over the OS ones (that are more "stupid" than Python or Java ones) is coded inside the interpreter. That's why extensions are needed, to make the C code deal with Python objects, exceptions and threads (exceptions and new object definitions are actually handled in a Python wrapper module, and not directly in the C extension, but anyway that's a logical part of the extension as well). Is it correct? Did I catch the real reasons? thanks for your help, Silvio. |