From: brian z. <bz...@zi...> - 2005-01-16 07:26:41
|
I hacked together a quick script to show the attributes missing from the various modules in Jython. It's available here: http://ziclix.com/jython/missing/ The modules with a leading * indicates the module doesn't exist at all in Jython. The bullets list the missing attributes per implementation. I ran this with Jython from cvs and python2.3. It's not perfect but it's a start. Anyone interested in looking at some of these? I've already written the sets module. thanks, brian |
From: Alan K. <jyt...@xh...> - 2005-01-16 12:37:14
|
[brian zimmer] > It's available here: http://ziclix.com/jython/missing/ > Anyone interested in looking at some of these? I've already > written the sets module. Brian, I already have 1. A mostly working cpython-2.3-compatible socket module, including support for timeouts, non-blocking mode, etc, etc. 2. A mostly working cpython-2.3-compatible select module, including support for both poll objects and select functions. 3. The design for a java.nio-native asyncore module. All of these are layered on java.nio, and all are written in jython. When I say "mostly working", I mean mostly passing the relevant cpython test suites. They still require a fair amount of work. They require cleaning up, and there are still a couple of bugs that need to be chased down. Lastly, I am uncertain on how to handle socket errors and exceptions: should I try to emulate the cpython exception interface, or just pass the java.nio exceptions directly? Or both, and offer a cpython-compatibility mode, so that existing cpython non-blocking code can be run out-of-the-box? I expect that I'll find the time to finish them off sometime before the summer. Does that fit in with your timetable, Brian? Alternatively, if anyone out there feels they have the requisite java.nio and cpython 2.3/2.4 socket experience, I will consider proposals to provide assistance, and thus advance the timetable. Regards, Alan. |
From: brian z. <bz...@zi...> - 2005-01-19 03:31:32
|
Sometime before summer would be fine. I can offer a hand in any development. I have already written my own version of select in java (http://cvs.sourceforge.net/viewcvs.py/zxpy/zxSocket/) but I've learned a lot since then as I implemented nio for work. The benefits of having select can not be understated as far as I'm concerned. Switching from threads to nio was a tremendous boon. The one problem I remember having was deciding how to handle the data in the ByteBuffer after reading from the socket. I wasn't sure whether I needed to decode the data or not because I didn't know what the requester wanted. Do you have the code available so I can see how you accomplished this? I haven't looked at my implementation in a long time and I didn't complete the full socket functionality. How did you handle errno or did you use the version in CVS? thanks, brian On Jan 16, 2005, at 06:39 AM, Alan Kennedy wrote: > [brian zimmer] > > It's available here: http://ziclix.com/jython/missing/ > > > Anyone interested in looking at some of these? I've already > > written the sets module. > > Brian, > > I already have > > 1. A mostly working cpython-2.3-compatible socket module, including > support for timeouts, non-blocking mode, etc, etc. > > 2. A mostly working cpython-2.3-compatible select module, including > support for both poll objects and select functions. > > 3. The design for a java.nio-native asyncore module. > > All of these are layered on java.nio, and all are written in jython. > When I say "mostly working", I mean mostly passing the relevant > cpython test suites. > > They still require a fair amount of work. They require cleaning up, > and there are still a couple of bugs that need to be chased down. > Lastly, I am uncertain on how to handle socket errors and exceptions: > should I try to emulate the cpython exception interface, or just pass > the java.nio exceptions directly? Or both, and offer a > cpython-compatibility mode, so that existing cpython non-blocking code > can be run out-of-the-box? > > I expect that I'll find the time to finish them off sometime before > the summer. > > Does that fit in with your timetable, Brian? > > Alternatively, if anyone out there feels they have the requisite > java.nio and cpython 2.3/2.4 socket experience, I will consider > proposals to provide assistance, and thus advance the timetable. > > Regards, > > Alan. > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-dev |
From: Ilia I. <ii...@ya...> - 2005-01-19 07:09:37
|
In case of socket and select it is best in my opinion to talk with Twisted folks. They had select emulated with thread long ago. http://twistedmatrix.com/documents/current/api/twisted.internet.javareactor.html Now they supported EIO http://java.twistedmatrix.com/eio/ --- brian zimmer <bz...@zi...> wrote: > Sometime before summer would be fine. I can offer a > hand in any > development. > > I have already written my own version of select in > java > (http://cvs.sourceforge.net/viewcvs.py/zxpy/zxSocket/) > but I've learned > a lot since then as I implemented nio for work. The > benefits of having > select can not be understated as far as I'm > concerned. Switching from > threads to nio was a tremendous boon. > > The one problem I remember having was deciding how > to handle the data > in the ByteBuffer after reading from the socket. I > wasn't sure whether > I needed to decode the data or not because I didn't > know what the > requester wanted. Do you have the code available so > I can see how you > accomplished this? I haven't looked at my > implementation in a long > time and I didn't complete the full socket > functionality. How did you > handle errno or did you use the version in CVS? > > thanks, > > brian > > On Jan 16, 2005, at 06:39 AM, Alan Kennedy wrote: > > > [brian zimmer] > > > It's available here: > http://ziclix.com/jython/missing/ > > > > > Anyone interested in looking at some of these? > I've already > > > written the sets module. > > > > Brian, > > > > I already have > > > > 1. A mostly working cpython-2.3-compatible socket > module, including > > support for timeouts, non-blocking mode, etc, etc. > > > > 2. A mostly working cpython-2.3-compatible select > module, including > > support for both poll objects and select > functions. > > > > 3. The design for a java.nio-native asyncore > module. > > > > All of these are layered on java.nio, and all are > written in jython. > > When I say "mostly working", I mean mostly passing > the relevant > > cpython test suites. > > > > They still require a fair amount of work. They > require cleaning up, > > and there are still a couple of bugs that need to > be chased down. > > Lastly, I am uncertain on how to handle socket > errors and exceptions: > > should I try to emulate the cpython exception > interface, or just pass > > the java.nio exceptions directly? Or both, and > offer a > > cpython-compatibility mode, so that existing > cpython non-blocking code > > can be run out-of-the-box? > > > > I expect that I'll find the time to finish them > off sometime before > > the summer. > > > > Does that fit in with your timetable, Brian? > > > > Alternatively, if anyone out there feels they have > the requisite > > java.nio and cpython 2.3/2.4 socket experience, I > will consider > > proposals to provide assistance, and thus advance > the timetable. > > > > Regards, > > > > Alan. > > > > > > > > > ------------------------------------------------------- > > The SF.Net email is sponsored by: Beat the > post-holiday blues > > Get a FREE limited edition SourceForge.net t-shirt > from ThinkGeek. > > It's fun and FREE -- well, > almost....http://www.thinkgeek.com/sfshirt > > _______________________________________________ > > Jython-dev mailing list > > Jyt...@li... > > > https://lists.sourceforge.net/lists/listinfo/jython-dev > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the > post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt > from ThinkGeek. > It's fun and FREE -- well, > almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-dev > |
From: Alan K. <jyt...@xh...> - 2005-01-19 13:19:47
|
[Ilia Iourovitski] > In case of socket and select it is best in my opinion > to talk with Twisted folks. > They had select emulated with thread long ago. > http://twistedmatrix.com/documents/current/api/twisted.internet.javareactor.html Hmm: *avoiding* threads is the whole point of using select. > Now they supported EIO > http://java.twistedmatrix.com/eio/ While the EIO package looks interesting, the purpose of my jynio effort is to provide jython socket, select, and asyncore modules which are 100% compatible with the cpython versions, so that, ideally, code which is written to use the cpython modules will run *without modification* on jython. Regards, Alan. |
From: Alan K. <jyt...@xh...> - 2005-01-19 13:36:45
|
[Ilia Iourovitski] > In case of socket and select it is best in my opinion > to talk with Twisted folks. > They had select emulated with thread long ago. http://twistedmatrix.com/documents/current/api/twisted.internet.javareactor.html Hmm: *avoiding* threads is the whole point of using select. > Now they supported EIO > http://java.twistedmatrix.com/eio/ While the EIO package looks interesting, the purpose of my effort is to provide jython socket, select, and asyncore modules which are 100% compatible with the cpython versions, so that, ideally, code which is written to use the cpython modules will run *without modification* on jython. Regards, Alan. |
From: Ilia I. <ii...@ya...> - 2005-01-19 21:15:32
|
As far as I understand the main reason to implement select is to have asyncore and medusa back to jython. EIO is much closer to asyncore than java.nio. Just a thought. Thx, Ilia --- Alan Kennedy <jyt...@xh...> wrote: > [Ilia Iourovitski] > > In case of socket and select it is best in my > opinion > > to talk with Twisted folks. > > They had select emulated with thread long ago. > http://twistedmatrix.com/documents/current/api/twisted.internet.javareactor.html > > Hmm: *avoiding* threads is the whole point of using > select. > > > Now they supported EIO > > http://java.twistedmatrix.com/eio/ > > While the EIO package looks interesting, the purpose > of my effort is to > provide jython socket, select, and asyncore modules > which are 100% > compatible with the cpython versions, so that, > ideally, code which is > written to use the cpython modules will run *without > modification* on > jython. > > Regards, > > Alan. > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the > post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt > from ThinkGeek. > It's fun and FREE -- well, > almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-dev > |
From: Carlos Q. <jy...@cq...> - 2005-01-18 14:22:36
|
Hi I could try to pick a few simple ones. Could you point a bit more what should be done. Taking for example time I get this: time Python * classDictInit Jython * __file__ * __name__ * strptime * struct_time * tzset missing-time.xml What does this means? Is that Jython is missing the attributes __file__, __name__ etc? What does it means if something is under in Python like this classDictInit? Other questions: In principle some of this could be just copied from the Python implementation? Do they need tests? Regards Carlos On Sun, 16 Jan 2005 01:26:39 -0600, "brian zimmer" <bz...@zi...> said: > I hacked together a quick script to show the attributes missing from > the various modules in Jython. > > It's available here: http://ziclix.com/jython/missing/ > > The modules with a leading * indicates the module doesn't exist at all > in Jython. The bullets list the missing attributes per implementation. > I ran this with Jython from cvs and python2.3. It's not perfect but > it's a start. > > Anyone interested in looking at some of these? I've already written > the sets module. > > thanks, > > brian > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-dev |
From: Brian Z. <bz...@zi...> - 2005-01-18 14:49:58
|
Sorry, l'll make myself more clear. So in your example, Python is missing 'classDictInit' which is a Jython-only attribute and should not be exposed to the dir(). In general, if Jython adds something it's because Java reflection finds something ('classDictInit') and exposes without being explicitly told not to. There are two ways to hide Java methods/attributes. Either adding the clause 'throws PyIgnoreMethodTag' to the method signature so Jython will not expose it or in classDictInit setting the __dict__ entry for the attribute to null. On the Jython side, it does not implement the methods/attributes listed. So for example, Jython's time module is missing strptime. Could this be copied from Python? Absolutely. If the module is implemented in Python we can use it. If implemented in C then it will have to be ported. The tests it should pass are the standard CPython tests for that module. Some of the features of a module will not be able to be implemented in Java without JNI and while we're dropping JDK1.1 support adding JNI requirements is not going to happen in the core. thanks, brian Carlos Quiroz wrote: > Hi > > I could try to pick a few simple ones. > Could you point a bit more what should be done. Taking for example time > I get this: > > time > > Python > * classDictInit > Jython > * __file__ > * __name__ > * strptime > * struct_time > * tzset > > missing-time.xml > > > What does this means? Is that Jython is missing the attributes __file__, > __name__ etc? > What does it means if something is under in Python like this > classDictInit? > > Other questions: > In principle some of this could be just copied from the Python > implementation? > Do they need tests? > > Regards > Carlos > On Sun, 16 Jan 2005 01:26:39 -0600, "brian zimmer" <bz...@zi...> > said: > >>I hacked together a quick script to show the attributes missing from >>the various modules in Jython. >> >>It's available here: http://ziclix.com/jython/missing/ >> >>The modules with a leading * indicates the module doesn't exist at all >>in Jython. The bullets list the missing attributes per implementation. >> I ran this with Jython from cvs and python2.3. It's not perfect but >>it's a start. >> >>Anyone interested in looking at some of these? I've already written >>the sets module. >> >>thanks, >> >>brian >> >> >> >>------------------------------------------------------- >>The SF.Net email is sponsored by: Beat the post-holiday blues >>Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. >>It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt >>_______________________________________________ >>Jython-dev mailing list >>Jyt...@li... >>https://lists.sourceforge.net/lists/listinfo/jython-dev > > |