[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Jython



On Tue, Apr 26, 2005 at 03:09:44PM -0400, Bob Ippolito wrote:
> 
> On Apr 26, 2005, at 2:47 PM, Alexandre Passos wrote:
> 
> >On 4/26/05, Fred Burton <flbl@xxxxxxxxxxxxxx> wrote:
> >>Technically, someone could implement SDL/pygame in java, and try to 
> >>make
> >>that work (right?)
> >
> >Well, if you actually reimplemented SDL in Java (or in the JNI),
> >there'd be little need for a pygame-like wrapper if you wanted to
> >access it via Jython.
> >But it could be done, by someone brave enough to delve that deeply
> >into the JNI (from what I've seen, it's not pretty)
> 
> That sure sounds like the tail wagging the dog though.  Why go through 
> all that trouble to end up with something that requires platform 
> specific compilation that can not be run in a Java sandbox and yet 
> still succumbs to the limitations of SDL (must use an entire single 
> window, no native widgets, etc.).
> 
> A more sane alternative would be to implement something entirely 
> separate from pygame implemented in terms of Java APIs (AWT or SWT, 
> etc.), but that exposes a similar API at the Python level.  That would 
> be nice for somebody, I guess.
> 
> Either way, such an effort would no longer be pygame.. so it's largely 
> irrelevant.  pygame is and always will be, by definition, a SDL wrapper 
> extension for C Python.  Anything else would be something else :)
> 
> -bob
> 

To clarify and emphasize Bob's point:

SDL can't run in Java without JNI. JNI means "Java Native Interface", 
and if you are using it, it means that you have thrown Java's 
cross-platformness out the window, and you have thrown Java's security 
model out the window. JNI (and by extension, SDL on Java) is only ever 
useful to someone who does not care about security or portability, and 
is just using Java because they happen to love the language.

Obviously, if you are using Jython, you are not using Java because you 
love the Java language, you are using Java because you love Python, but 
python doesn't allow you to write an python applet to plug into a web 
page, and you need java/jython's sandbox security model do do that-- 
which you can't if you are using JNI

---
Bob the Hamster