Python...cross-platform...Java -- JPE?

Jonathan P. jbperez808 at spamless.com
Thu Oct 16 09:42:11 EDT 2003


Jarek Zgoda wrote:

>> Harry George wrote:
>>
>>In theory I agree.  But in practice I (and perhaps others) live in a
>>Java-dominated world.  Corporate direction is very J2EE, with all the
>>XML complexification IBM nd SUN can throw at Web Services.  So I need
>>Python to play well with Java and vice versa.  Jython is not the
>>answer for us (we need lots of CPython extensions).
> 
> 
> I can say the same from my perspective (multinational assurance
> company). While our Python adoption in AS/400 area was relatively easy,
> the PC area is dominated by Java, mostly due do gazillions of "business
> presentations" that we attend each year at Oracle, IBM, BEA and so many
> others, that I can not remember their names. They have funds for
> marketing that no one can withstand. After a year of heavy using
> Python/400 nobody objects that it iss really awesome development
> platform, but theres one statement we hear after each such presentation
> when we mention Python -- "nobody uses it". Not just really nobody, it
> is "reletively nobody". We have some applications in Python in use, but
> is pure "partisan work".
> 
> Nobody got fired for using Java.

For business/enterprise systems, I would have to agree with
these two gentlemen regarding the status quo.

But for multimedia and games, Java has been straining to
give adequate performance and has yet to succeed, imo.  The
libSDL (pygame) and OpenGL (PyOpenGL) bindings give Python
games much higher performance than the J2SE graphics and
sound classes can muster.  SDL and OpenGL bindings are
available on Java but, perhaps due to the difficulty of
working with JNI, they seem to be taking forever to mature.

For (non-game/non-multimedia) desktop apps, Swing apps, with
the right Look and Feel, can look gorgeous (see jgoodies.com).
On 1Ghz+ machines they are no longer oppressively slow.
However, memory consumption is still a problem.

Python apps incur an overhead of roughly 4 to 10MB per
app instance (can someone confirm whether this is correct
or whether a chunk of that 4-10MB can be shared across
running instances?)

Java apps consume more than twice that(*) and afaik,
each app runs on its own, unshared instance of a JVM!

(*) ...and far worse in some cases: top reports usage
of 210mb per process(!) *and* /multiple/ processes for a
tiny Swing demo app!  While I'm sure memory consumption
is not as bad as top makes it look, it's still a pretty
good bet that it's going to be waaay bigger than with
PyGtk apps (esp. under Linux).  The disparity is less
when comparing Swing to PyGtk apps under Windows (~25MB vs.
~10MB minimum per running GUI app).

Deploying desktop Java apps is easier than Python because
the JRE is a one-shot install.  Tkinter has not met with
wide acceptance as a GUI for desktop apps, and Pygame,
PyOpenGL, PyGtk and PyGtkGLExt all have to be separately
installed for now.  So, in this aspect, Java might have a
leg up.

Now, I'm not sure we would want the equivalent of a JRE for
Python, as freezing Python apps and deploying them as
fully contained installer packages (like other Windows
apps) seems to work fairly well.

But there is something to be said about how neat the JRE
approach is.  You can package up your whole non-trivial
java app into a _single_ jar file and all the end-user has
to do is do a 'java -jar xxx.jar'.  Python has yet to
standardize on such a delivery method as distutils is
nowhere near as straightforward a system.

Ironically, instead of touting the ease with which jar
packaged Java apps can be run, Sun is overdoing things
by coming up with the obnoxious Web Start and JNLP which
are virtually guaranteed to make a mess of your Java setup.
Many software authors and vendors have even resorted to
deploying purely using Web Start/JNLP and do not provide
jars - ugh!





More information about the Python-list mailing list