From: <mag...@ya...> - 2002-02-26 13:33:06
|
Greetings! I just want to know if Jython is supported by Zope? I'm new to Python so go easy on me. :) Is there any other way to use Python to access serialized Java objects? Thanks! Regards, Bill Russell Gagalac-Nicolas --------------------------------- Do You Yahoo!? Get personalised at My Yahoo!. |
From: Samuele P. <pe...@in...> - 2002-02-26 19:44:56
|
[Terry Hancock] > However, > Jython is strictly a *client-side* technology and > Zope is strictly *server-side* Yup Zope is server-side but Jython is not strictly a client-side technology <wink>, it is just a language implementation, today one can write applets but also servlets in Jython etc. Apropos of Jython and Zope, typically people would like to see Zope ported to Jython in order to achieve some kind of tight J2EE integration. This is a very high-level plan and concretely could mean a lot of things ... There have been some ongoing efforts to port Zope to Jython (now mostly frozen): www.phabric.org and in this interview http://www.zopera.org/Members/odeckmyn/fulton_iv_2002 Jim Fulton declares to expect some kind of (Zope's ?) commutity effort to port Zope to Jython, once Zope is at 3 and Jython at 2.2. Until then probably not much will happen. regards, Samuele Pedroni. |
From: Terry H. <ha...@an...> - 2002-02-26 18:50:46
|
Nicolas Bill Russell wrote: > I just want to know if Jython is supported by Zope? I'm new to Python > so go easy on me. :) As far as I know (and I've been looking -- still am), there's no direct support for Jython in Zope. However, Jython is strictly a *client-side* technology and Zope is strictly *server-side* -- so in principle, there isn't much overlap. You could use DTML Methods/ Documents and File objects to hold the Jython code and the interpreter. What would be kind of cool, though, is a Zope product to encapsulate a Jython applet as a Zope object. I think it ought to: 1) Provide a syntax-sensitive editing interface (can we just use the one currently provided for Python scripts? I'm not sure if the syntax is similar enough. I mean -- is the syntax checker aware of standard modules (which may differ) or just legal Python syntax (which should be the same)? Actually, it occurs to me that this may not really be a "syntax checker" -- is it actually just importing the module and reporting the traceback from that? In which case, this is really the same as #3 below. 2) Automatically provide the wrapper code to deliver the Jython interpreter applet and generate the correct <applet> tags, etc. This would be akin to what Zope does for images. 3) It might be good to actually pre-compile into a .jar file (or whatever is appropriate -- I'm a Java/Jython newbie, so go easy on _me_ too ;) ), on the server. Probably one should do this whenever the program is edited on the server, and report errors/traceback from the program. This probably has to be done from an unrestricted Python module (which may in turn call other programs on the server, such as jythonc), so that means putting it in as an External method, or (better) including it in a Zope Product. With Jython, there's an obvious cache-optimization problem -- you want to make sure you only download the core/interpreter part once, and the applets separately. You also want to avoid triggering various security problems with client-side code, which seem to happen when you evaluate/execute strings inside of Python. This probably ought to be done on the server if it can't be avoided (?). It seems to me that there's enough repetitive work here to justify making a special product to simplify it. If you had this, I think you could just edit a Jython client-side method in Zope, save it (which would compile and store on the server), and then embed it into a DTML document, using <dtml-var myJythonObject>. I was thinking of waiting until the O'Reilly book on Jython comes out (I'm not experienced at Java, so I don't think the other book is going to help me so much), and then having a go at writing such a product myself, since I want to do a fairly large amount of Jython stuff with Zope. My attraction to this is the beauty of having both server and client programmed in the same programming language (Python), instead of having to learn and interface between two different ones. This would also reduce the burden of deciding where to draw the line between server- and client-side components, since they would then be relatively easy to port back and forth. So ... Has anyone already done this (and I'm just not so good at finding it), or is anyone interested in collaborating / discussing this with me? Cheers, Terry -- ------------------------------------------------------ Terry Hancock ha...@an... Anansi Spaceworks http://www.anansispaceworks.com P.O. Box 60583 Pasadena, CA 91116-6583 ------------------------------------------------------ |
From: Chris W. <ch...@ni...> - 2002-02-26 19:33:42
|
Terry Hancock wrote: > > Nicolas Bill Russell wrote: > > I just want to know if Jython is supported by Zope? I'm new to Python > > so go easy on me. :) > > As far as I know (and I've been looking -- still am), > there's no direct support for Jython in Zope. However, > Jython is strictly a *client-side* technology and > Zope is strictly *server-side* -- so in principle, there > isn't much overlap. Urm, I think you may be misunderstanding Jython. Jython is an implementation of the Python language in Java rather than C, as used by normal python. So, as such, Jython is only as client-side as python is. However, you can't run Zope on Jython because Zope requires several C-Extensions to Python which wouldn't work under Jython. cheers, Chris |
From: Terry H. <ha...@an...> - 2002-02-26 20:33:47
|
Chris Withers wrote: > Urm, I think you may be misunderstanding Jython. Jython is an implementation of > the Python language in Java rather than C, as used by normal python. No, I'm not misunderstanding Jython -- I just think about it differently. You're right of course, that you *could* run Jython on the server. However, I can't (so far) think of *any* compelling reason to do so (which is not to say that other people can't, of course). > So, as such, Jython is only as client-side as python is. The point is that Python *isn't* very client side at all, but Jython can be. > However, you can't run Zope on Jython because Zope requires several C-Extensions > to Python which wouldn't work under Jython. Sure, but, again, why would I want to anyway? It'd be slower, and I cannot think of a platform where it wouldn't be easier to just run Zope on Python. (Anyway who cares? I'm only going to run it on Linux or Unix, anyway, why use anything else -- I get to pick my server -- it's the client platform I can't control). Frankly, I see applets as the main value in Jython. The ability to run it in JVM applications seems to have little use to me. Why not just use Python? The only reason I can imagine is if I had a whole lot of stuff already in Java that I wanted to use, or if I wanted to run on a (hypothetical?) platform which can't compile Python, but does have a JVM. But I don't, and I don't know Java. I know C and Python, so I'd feel much more comfortable using those, if I have to write from scratch. So for me, Jython *is* of interest strictly as a client-side tool -- just as I said. But this is not a bad thing... The point is, that to a Python programmer who's already using Zope, the place Jython makes sense is on the client side (any server-side application will almost certainly be better served by using Python). However, the case for using Jython on the client is very compelling -- there are a lot of exciting possibilities for that if you can just get started on it. For me, the tricky part is understanding enough to build and deploy the applet correctly. This is mostly a *Java* problem, not Jython as such. Thus, the concept of creating a Zope product to launch Jython applets seems very useful. It would take care of all those nasty Java details, and allow us to just think about the Python part. IMHO, of course, Terry -- ------------------------------------------------------ Terry Hancock ha...@an... Anansi Spaceworks http://www.anansispaceworks.com P.O. Box 60583 Pasadena, CA 91116-6583 ------------------------------------------------------ |
From: John Z. <jz...@sp...> - 2002-02-26 20:42:57
|
Actually, I've seen a growing number of instances (at least two ;) where people are using Jython because you get to "extend" Jython with Java classes in the same manner that you can extend CPython with C modules/types. This is a _very_ powerful dev model for a Java team, IMO. Being able to do this in Zope would certainly be benficial to a lot of people if they already have, ot plan to develop a non-trivial amount of code in Java. > Chris Withers wrote: > >>Urm, I think you may be misunderstanding Jython. Jython is an implementation of >>the Python language in Java rather than C, as used by normal python. >> > > No, I'm not misunderstanding Jython -- I just think about > it differently. You're right of course, that you *could* > run Jython on the server. However, I can't (so far) think > of *any* compelling reason to do so (which is not to say > that other people can't, of course). |
From: <mag...@ya...> - 2002-02-26 21:31:02
|
The reason why I want to use Jython is that I need to access serialized Java objects. I've designed a system that uses objects as the main storage media rather than databases. I used Java for the frontend of my system (Swing GUIs and object serialization) and is planning to use Python (Jython) for client-side processing of Java objects. Is there any other (simpler) way to access Java objects using Python? Thanks, Bill Russell Gagalac-Nicolas --------------------------------- Do You Yahoo!? Get personalised at My Yahoo!. |
From: Chris W. <ch...@ni...> - 2002-02-27 07:45:53
|
John Ziniti wrote: > > Actually, I've seen a growing number of instances (at least > two ;) where people are using Jython because you get to > "extend" Jython with Java classes in the same manner that > you can extend CPython with C modules/types. This is a > _very_ powerful dev model for a Java team, IMO. I don't know if it'd work, but personally, I'd try JPE first: http://sf.net/projects/jpe cheers, Chris |
From: seb b. <se...@ja...> - 2002-02-27 10:04:20
|
On Tue, 2002-02-26 at 20:32, Terry Hancock wrote: > I was thinking of waiting until the O'Reilly book > on Jython comes out The New Riders book on the subject is pretty good. seb |
From: Kevin B. <kb...@ca...> - 2002-02-26 22:33:10
|
Terry Hancock wrote: > > Chris Withers wrote: > > Urm, I think you may be misunderstanding Jython. Jython is an implementation of > > the Python language in Java rather than C, as used by normal python. > > No, I'm not misunderstanding Jython -- I just think about > it differently. ... > Frankly, I see applets as the main value in Jython. Sounds like you're misunderstanding Jython. :-) I think I wrote an applet in Jython once. :-) The download time was problematic for me, and I'm not all that big on applets anyway... > The > ability to run it in JVM applications seems to have > little use to me. Why not just use Python? The only > reason I can imagine is if I had a whole lot of > stuff already in Java that I wanted to use Yes - I use Jython extensively to explore, test, prototype, & implement Java systems & utilities. I'm still trying to come up with a way that will make it as easy to extend CPython as it is to extend Jython... > I don't know Java. > I know C and Python, I think this is where your atypical perspective comes from - coming from Python, you look at Jython and see that it doesn't really add much capability, except "Cool! I can run in a browser!". There seems to be a larger community of people doing Java things who look at Jython and say, "Cool! [JP]ython makes it really easy to do all these Java things!" Both viewpoints are definitely valid, it is just that there is a larger Java community than a Python community, so the second opinion is more common. The-blind-man-who-thought-Jython-was-like-a-snake-was-right-ly y'rs kb --- "The Blind Men and the Elephant; There is a famous story about six blind men encountering an elephant for the first time. Each man, seizing on the single feature of the animal, which he appeared to have touched first, and being incapable of seeing it whole, loudly maintained his limited opinion on the nature of the beast. The elephant was variously like a wall, a spear, a snake, a tree, a fan or a rope, depending on whether the blind men had first grasped the creature's side, tusk, trunk, knee, ear or tail." http://shop.store.yahoo.com/africanworld/0865437297.html |