Mixing different interpreters in the same program

J

Jaime Buelta

Hello:

I keep thinking from some time ago in how to conect two or more
Python interpreters. This began as interest in calling Java code from
C program, which was solved (at the time) using an intermediate file.

But having CPython and Jython, I think it would be great to call a
function from, let's say, a CPython interpreter and execute java code.

I been reading about the multiprocessing module, but doesn't been
able to call the Jython interpreter from CPython. Also, Jython is
still at version 2.5 and doesn't have the multiprocessing, so it won't
probably work either.

Any way, thinking like a "wish list", I think it will be very
interesting a module with the following behaviour to make python even
more powerful in gluing things up.
Could make "from MyModule import java" or "from MyModule import
jython", so the module will start a jython interpreter. Then call code
to be executed on the jython interpreter like 'jython.javafunction'

Of course, it could be also an "import ironpython" to start an
IronPython or any other Python interpreter configured. Or "import
cpython" from jython.

Regarding performance, which I think won't be never great at it has
some overhead setting interpreters up, sending data, etc, it will be
great to add a MyModule.exec(function) to execute completely a funtion
on the "remote interpreter"

Well, just thinking about some ideas and sharing with you ;-)

Best regards,
Jaime
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top