Does PyPy supports Java ME?
Hi, I was currently working on a port of PyMite (8-Bit MCU port of CPython) to Java ME. I already got the interpreter working so that basic Python scripts could run as code images on a mobile java IMP device. Actually we need Python interpreters on different embedded platforms supporting either C or Java ME (IMP). I discovered a lot of problems including the missing class implementation of PyMite. Then, by recommendation, I found PyPy. It looks as if it is exactly what I was looking for and I read that it is specifically designed to support embedded platforms. But I want to clarify a few things: 1.) Does PyPy generate both C and Java Bytecode for the Interpreter out of the box or with low effort? 2.) Is the java code compatible with Java ME or is it possible to modify the PyPy-code/Interpreter-code so that Java ME is supported? 3.) What standard libraries are supported? I coulnd't find a list. Especially the communication (such as socket) functionality is important. 4.) Do you think PyPy is stable enough for commercial use? The MIT license allows commercial use as far as I read. Thank you very much! Regards, Jan
Hi Jan, Jan Wedel wrote:
1.) Does PyPy generate both C and Java Bytecode for the Interpreter out of the box or with low effort?
yes
2.) Is the java code compatible with Java ME or is it possible to modify the PyPy-code/Interpreter-code so that Java ME is supported?
I don't know what are the requirements/restrictions for Java ME. If the restrictions are only about the library, it's possible that it works out of the box as pypy-jvm doesn't use many external libraries. However, note that you might have memory problems because the binary it's kind of big (the JAR file is ~8-10 MB, IIRC).
3.) What standard libraries are supported? I coulnd't find a list. Especially the communication (such as socket) functionality is important.
unfortunately, you cannot access any external java library from pypy-jvm so far. I agree that it makes it a bit pointless, but basically nobody ever cared enough/had time to add support for it. I plan to do it at some point, but surely not before I finish my PhD (which is supposed to finish at the end of next april).
4.) Do you think PyPy is stable enough for commercial use? The MIT license allows commercial use as far as I read.
The Python interpreter in PyPy is quite stable and compliant with CPython. However, the resulting pypy-jvm has never been extensively tested as far as I know, so it's likely to have undiscovered bugs (but usually they are easy to fix). So, to sum up: I'm sorry but pypy-jvm is not usable for production right now; it could be made useful with relatively low effort if someone invested time and/or money on it, but I don't think it's going to happen very soon. ciao, Anto
Hi Jan, On Tue, Oct 06, 2009 at 15:15 +0200, Jan Wedel wrote:
I was currently working on a port of PyMite (8-Bit MCU port of CPython) to Java ME. I already got the interpreter working so that basic Python scripts could run as code images on a mobile java IMP device. Actually we need Python interpreters on different embedded platforms supporting either C or Java ME (IMP). I discovered a lot of problems including the missing class implementation of PyMite.
Then, by recommendation, I found PyPy. It looks as if it is exactly what I was looking for and I read that it is specifically designed to support embedded platforms.
Do you have a pointer to documentation or a text that says so? I wouldn't see PyPy this way. However, we do have a pypy-c version that works on Maemo and is more efficient for larger amounts of user objects. We also have ideas how to reduce RSS size after interpreter startup, mostly tied to pypy-c so far, though. In principle it's also possible to translate RPython to C or JVM and avoid interpretation alltogether. RPython is >50 times faster than CPython but less convenient to work with than regular Python so only makes sense to consider for special purposes. And is probably best learned in collaboration with developers who know how to work with it and are willing or paid to help. cheers, holger -- Metaprogramming, Python, Testing: http://tetamap.wordpress.com Python, PyPy, pytest contracting: http://merlinux.eu
Do you have a pointer to documentation or a text that says so?
It should be possible with future versions of PyPy to use the
Yes : http://codespeak.net/pypy/extradoc/eu-report/D11.1_PyPy_for_Embedded_Devices... framework in other ways in the embedded context
for instance by shipping a restricted version of the interpreter, dedicated to the interpretation of a given set of programs.
I think I read something more precise but I couldn't find it anymore. -----Ursprüngliche Nachricht----- Von: holger krekel [mailto:holger@merlinux.eu] Gesendet: Donnerstag, 8. Oktober 2009 15:17 An: Jan Wedel Cc: pypy-dev@codespeak.net Betreff: Re: [pypy-dev] Does PyPy supports Java ME? Hi Jan, On Tue, Oct 06, 2009 at 15:15 +0200, Jan Wedel wrote:
I was currently working on a port of PyMite (8-Bit MCU port of CPython) to Java ME. I already got the interpreter working so that basic Python
scripts could run as code images on a mobile java IMP device. Actually
we need Python interpreters on different embedded platforms supporting
either C or Java ME (IMP). I discovered a lot of problems including the missing class implementation of PyMite.
Then, by recommendation, I found PyPy. It looks as if it is exactly what I was looking for and I read that it is specifically designed to support embedded platforms.
Do you have a pointer to documentation or a text that says so? I wouldn't see PyPy this way. However, we do have a pypy-c version that works on Maemo and is more efficient for larger amounts of user objects. We also have ideas how to reduce RSS size after interpreter startup, mostly tied to pypy-c so far, though. In principle it's also possible to translate RPython to C or JVM and avoid interpretation alltogether. RPython is >50 times faster than CPython but less convenient to work with than regular Python so only makes sense to consider for special purposes. And is probably best learned in collaboration with developers who know how to work with it and are willing or paid to help. cheers, holger -- Metaprogramming, Python, Testing: http://tetamap.wordpress.com Python, PyPy, pytest contracting: http://merlinux.eu
On Thu, Oct 08, 2009 at 15:30 +0200, Jan Wedel wrote:
Do you have a pointer to documentation or a text that says so?
Yes :
http://codespeak.net/pypy/extradoc/eu-report/D11.1_PyPy_for_Embedded_Devices...
It should be possible with future versions of PyPy to use the framework in other ways in the embedded context for instance by shipping a restricted version of the interpreter, dedicated to the interpretation of a given set of programs.
I think I read something more precise but I couldn't find it anymore.
That use case study mainly worked with using RPython and says that its efficiency is not far from using C. I guess this could be extended to also apply for Java-ME so that an RPython program would run as fast as native Java. A restricted version of the existing Python interpreter is quite a lot of work and it's unclear how successful it could be. Python might be an easy-to-read and to-learn language but it's internals are quite complex, unfortunately. best, holger
-----Ursprüngliche Nachricht----- Von: holger krekel [mailto:holger@merlinux.eu] Gesendet: Donnerstag, 8. Oktober 2009 15:17 An: Jan Wedel Cc: pypy-dev@codespeak.net Betreff: Re: [pypy-dev] Does PyPy supports Java ME?
Hi Jan,
On Tue, Oct 06, 2009 at 15:15 +0200, Jan Wedel wrote:
I was currently working on a port of PyMite (8-Bit MCU port of CPython) to Java ME. I already got the interpreter working so that basic Python
scripts could run as code images on a mobile java IMP device. Actually
we need Python interpreters on different embedded platforms supporting
either C or Java ME (IMP). I discovered a lot of problems including the missing class implementation of PyMite.
Then, by recommendation, I found PyPy. It looks as if it is exactly what I was looking for and I read that it is specifically designed to support embedded platforms.
Do you have a pointer to documentation or a text that says so? I wouldn't see PyPy this way. However, we do have a pypy-c version that works on Maemo and is more efficient for larger amounts of user objects. We also have ideas how to reduce RSS size after interpreter startup, mostly tied to pypy-c so far, though.
In principle it's also possible to translate RPython to C or JVM and avoid interpretation alltogether. RPython is >50 times faster than CPython but less convenient to work with than regular Python so only makes sense to consider for special purposes. And is probably best learned in collaboration with developers who know how to work with it and are willing or paid to help.
cheers, holger
-- Metaprogramming, Python, Testing: http://tetamap.wordpress.com Python, PyPy, pytest contracting: http://merlinux.eu
_______________________________________________ pypy-dev@codespeak.net http://codespeak.net/mailman/listinfo/pypy-dev
-- Metaprogramming, Python, Testing: http://tetamap.wordpress.com Python, PyPy, pytest contracting: http://merlinux.eu
participants (3)
-
Antonio Cuni
-
holger krekel
-
Jan Wedel