Thread: [Pydev-code] Jython<->CPython for Scripting
Brought to you by:
fabioz
From: Don T. <nos...@gm...> - 2006-04-04 14:53:44
|
Fabio: Do you know if it is possible to interface Jython to CPython? I was wondering if it would be possible to simply use Jython to write a bunch of adapters between Java and CPython so that CPython 2.4 could be used as the scripting language. I guess it could be done in separate processes, but I was wondering about the possibility of having both in the same process. Don. |
From: Fabio Z. <fa...@gm...> - 2006-04-04 15:40:14
|
I guess you could do it with some tool to embed cpython in java... There are some projects that say they support this (note that I never tried any of those): http://jepp.sourceforge.net/ http://jpe.sourceforge.net/ http://jpype.sourceforge.net/roadmap.html Cheers, Fabio On 4/4/06, Don Taylor <nos...@gm...> wrote: > > Fabio: > > Do you know if it is possible to interface Jython to CPython? > > I was wondering if it would be possible to simply use Jython to write a > bunch of adapters between Java and CPython so that CPython 2.4 could be > used as the scripting language. > > I guess it could be done in separate processes, but I was wondering > about the possibility of having both in the same process. > > Don. > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Fabio Z. <fa...@gm...> - 2006-04-04 17:02:54
|
I guess you could do it with some tool to embed cpython in java... There are some projects that say they support this (note that I never tried any of those): http://jepp.sourceforge.net/ http://jpe.sourceforge.net/ http://jpype.sourceforge.net/roadmap.html Cheers, Fabio On 4/4/06, Don Taylor <nos...@gm...> wrote: > > Fabio: > > Do you know if it is possible to interface Jython to CPython? > > I was wondering if it would be possible to simply use Jython to write a > bunch of adapters between Java and CPython so that CPython 2.4 could be > used as the scripting language. > > I guess it could be done in separate processes, but I was wondering > about the possibility of having both in the same process. > > Don. > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Don T. <nos...@gm...> - 2006-04-10 23:48:58
|
Fabio Zadrozny wrote: > I guess you could do it with some tool to embed cpython in java... > > There are some projects that say they support this (note that I never > tried any of those): > http://jepp.sourceforge.net/ > http://jpe.sourceforge.net/ > http://jpype.sourceforge.net/roadmap.html > Fabio: I had another look at these projects and you may be interested in using Jepp in Pydev as I believe that you ould use it to execute inline CPython from inside a Java program. Jep uses the Jni to allow Java to call CPython. As I understand it, you currently spawn separate processes for CPython components of Pydev, I think Jepp would let you run these components synchronously or inside a Java task. But Jep (presumably jep.dll) presently does seem to require a custom build for each pair (JRE version, Python version). I have not tried Jep because it will require some (difficult for me) build work to get it running on my machine. Don. |
From: Don T. <nos...@gm...> - 2006-04-04 21:21:10
|
Fabio Zadrozny wrote: > I guess you could do it with some tool to embed cpython in java... > > There are some projects that say they support this (note that I never > tried any of those): > http://jepp.sourceforge.net/ > http://jpe.sourceforge.net/ > http://jpype.sourceforge.net/roadmap.html > Thanks for this. None of these seem to be ready for prime time and they are not really what I have in mind. I was wondering how to invoke existing CPython stuff from a Jython script in Pydev. Given that there does not seem to be anything worth using I am assuming that you run at least some of Pydev's Python code in a separate process rather that in-process? For stuff like BRM which I doubt you would have ported that to Jython. I wonder what else is in straight Python? Did you develop a standard protocol for this that could be exposed to the scripting interface? Or would it be straightforward to do this directly in Jython. In more general terms, it would be very interesting to read an architectural overview of the design of Pydev. Don. |
From: Fabio Z. <fa...@gm...> - 2006-04-04 22:01:32
|
> > None of these seem to be ready for prime time and they are not really > what I have in mind. I was wondering how to invoke existing CPython > stuff from a Jython script in Pydev. Actually, if you're meaning in the same process, you'd need something that exposed the CPython api to java (as those projects try to do), but I agree, none seems to be in production... Given that there does not seem to be anything worth using I am assuming > that you run at least some of Pydev's Python code in a separate process > rather that in-process? For stuff like BRM which I doubt you would have > ported that to Jython. I wonder what else is in straight Python? Yes, BRM, code-completion (for builtins), debugging, code-coverage, etc. ar= e all in Python. Did you develop a standard protocol for this that could be exposed to > the scripting interface? Or would it be straightforward to do this > directly in Jython. Actually, there is not an actual protocol for everything... In the debugger it uses xml-rpc, in code-completion it just write messages directly (to try reducing the communication penalty). BRM uses the same thing code-completio= n does... Actually, thinking about it, that's the most 'standard' approach. The server at the cpython side is at org.python.pydev/pysrc/pycompletionserver.py (altough it is used for BRM too). Anyway, I'm not sure that would be a good way to go, as you'd have to pass all the objects you need to know about to the python side, so, the communication could make things VERY slow... Besides, you wouldn't have acess to the Eclipse internals. So, it does not appear such a good solution to me (if one of those projects could take care of that in the same process= , then it might be worth it, but otherwise, I think jython would be the best way to go). In more general terms, it would be very interesting to read an > architectural overview of the design of Pydev. > I'll try to write about it as I do a 'developers manual'. Cheers, Fabio |