ANNOUNCE: JPE, the Java-Python Extension - first beta release 
Author Message
 ANNOUNCE: JPE, the Java-Python Extension - first beta release

April 28, 2001

I am pleased to announce the first beta release of JPE,
the Java-Python Extension.

JPE is at once:
    - A python module (named 'java') providing access to all Java
services
      from Python
    - A Java package (named 'python') providing access to all Python
services
      from Java

Computing Paradigm
==================

JPE relies on the following computing paradigm:
One Python VM (PyInterp* pointer) an one Java VM (JavaVM* pointer) are
in the same process.
The virtual machines act as common process resources, shared by the
threads.

Each virtual machine has its own thread-specific execution environment
(PyThreadState* pointer in Python, JNIEnv* pointer in Java).
Each thread is attached to zero or one thread environment
from each virtual machine; each thread environment is attached
to one thread.

The paradigm is generic.
I have not done much research in the literature in this regard,
but I am not aware of a similar pattern.
I'll baptize it the "symmetrical virtual machine" pattern :))

This is different from Jython, for instance, in the sense that Jython
is an emulation of the Python VM, written in Java, and entirely running
within the Java VM.

The advantage of the symmetrical virtual machine approach
over the emulation is that we get to work with the actual,
full-featured Python VM, rather than with an emulation on top of
another virtual machine, emulation which necesseraly suffers
from limitations inherited from the emulating environment.

Object semantics are the same in both environments.

Voila!

Frederic Giacometti

The home of JPE is http://www.*-*-*.com/
JPE can be downloaded directly at http://www.*-*-*.com/



Fri, 17 Oct 2003 07:45:40 GMT  
 ANNOUNCE: JPE, the Java-Python Extension - first beta release

Quote:

>April 28, 2001

>I am pleased to announce the first beta release of JPE,
>the Java-Python Extension.

> [...]

I am also very pleased to see this come along. This will be a very useful tool
:-) erm ... Python <-> Java makes a lot more sense than Python <-> Ada 95, but
I am digressing ...

Hmm, the build process was a little frustrating for me, but in the end it built
(with a gazillion warnings). When I try to run the TestDND.py sample, I get the
following error message on Linux (Sun or Blackdown JDK, using Python 2.1):

jvmarg = ['-verbose:jni', '-Djava.library.path=.', '-Djava.class.path=.']
jpe.c:432 dlopen </opt/j2sdk1.3.0/jre/lib/i386/server/libjvm.so>
Error occurred during initialization of VM
Unable to load native library: shared object not open

Any idea?

Gerhard
--
mail:   gerhard <at> bigfoot <dot> de
web:    http://highqualdev.com



Fri, 17 Oct 2003 10:14:02 GMT  
 ANNOUNCE: JPE, the Java-Python Extension - first beta release

Quote:

> Hmm, the build process was a little frustrating for me, but in the end it built
> (with a gazillion warnings). When I try to run the TestDND.py sample, I get the
> following error message on Linux (Sun or Blackdown JDK, using Python 2.1):

> jvmarg = ['-verbose:jni', '-Djava.library.path=.', '-Djava.class.path=.']
> jpe.c:432 dlopen </opt/j2sdk1.3.0/jre/lib/i386/server/libjvm.so>
> Error occurred during initialization of VM
> Unable to load native library: shared object not open

> Any idea?

I had the same problem on Linux.
If somebody could help find the solution... (this works fine on Windows).

To bypass the problem on Linux/Unix, you can use something like 'java python.PyRun
TestDND.py' (cf. example in 'make testjava').

python.PyRun.main() should let you run Python scripts from within Java.
By doing this way, you don't have to initialize Java from Python, something that
still fails on Linux/Unix, with the message you noted.

Regards,

FG



Fri, 17 Oct 2003 19:52:25 GMT  
 ANNOUNCE: JPE, the Java-Python Extension - first beta release

Quote:

> Hmm, the build process was a little frustrating for me, but in the end it built
> (with a gazillion warnings). When I try to run the TestDND.py sample, I get the
> following error message on Linux (Sun or Blackdown JDK, using Python 2.1):

> jvmarg = ['-verbose:jni', '-Djava.library.path=.', '-Djava.class.path=.']
> jpe.c:432 dlopen </opt/j2sdk1.3.0/jre/lib/i386/server/libjvm.so>
> Error occurred during initialization of VM
> Unable to load native library: shared object not open

> Any idea?

I had the same problem on Linux.
If somebody could help find the solution... (this works fine on Windows).

To bypass the problem on Linux/Unix, you can use something like 'java python.PyRun
TestDND.py' (cf. example in 'make testjava').

python.PyRun.main() should let you run Python scripts from within Java.
By doing this way, you don't have to initialize Java from Python, something that
still fails on Linux/Unix, with the message you noted.

Regards,

FG



Fri, 17 Oct 2003 19:52:25 GMT  
 ANNOUNCE: JPE, the Java-Python Extension - first beta release

Quote:


> >April 28, 2001

> >I am pleased to announce the first beta release of JPE,
> >the Java-Python Extension.

> > [...]

> I am also very pleased to see this come along. This will be a very useful tool
> :-) erm ... Python <-> Java makes a lot more sense than Python <-> Ada 95, but
> I am digressing ...

> Hmm, the build process was a little frustrating for me, but in the end it built
> (with a gazillion warnings). When I try to run the TestDND.py sample, I get the

Java does not provide opaque pointer capability (something like Python's COjbect).
The concept is dearly missing to Java (a basic type matching a void* memory
address, and whose value could be accessible only from the Java/JNI C programming
interface).

So, all references (pointers) to Python objects have to be cast back and forth to
jlong (Java long) to be carried around in the Java objects.

Visual C++ keeps this silent, on some Unix compilers (Tru64), specific warnings can
be turned off, but I could not find the feature on gcc...
To keep the gcc compiler noise low when developping, I'll convert all casts using
the following definitions (2 macro/function pairs):

#ifdef JPE_NOLONGCASTWARNING
  static void* jlong2void( jlong ref) {return (void*)ref;}
  static jlong void2jlong( void* ref) {return (jlong)ref;}
# define Jlong2void( ref) jlong2void( ref)
# define Void2jlong( ref) void2jlong( ref)
#else
# define Jlong2void( ref) ((void*)(ref))
# define Void2jlong( ref) ((jlong)(ref))
#endif

That way, the gadzillon warnings will be reduced to 2 warnings, at the expense of
an additional function call...

FG



Sat, 18 Oct 2003 06:46:07 GMT  
 ANNOUNCE: JPE, the Java-Python Extension - first beta release

Quote:


> >April 28, 2001

> >I am pleased to announce the first beta release of JPE,
> >the Java-Python Extension.

> > [...]

> I am also very pleased to see this come along. This will be a very useful tool
> :-) erm ... Python <-> Java makes a lot more sense than Python <-> Ada 95, but
> I am digressing ...

> Hmm, the build process was a little frustrating for me, but in the end it built
> (with a gazillion warnings). When I try to run the TestDND.py sample, I get the

Java does not provide opaque pointer capability (something like Python's COjbect).
The concept is dearly missing to Java (a basic type matching a void* memory
address, and whose value could be accessible only from the Java/JNI C programming
interface).

So, all references (pointers) to Python objects have to be cast back and forth to
jlong (Java long) to be carried around in the Java objects.

Visual C++ keeps this silent, on some Unix compilers (Tru64), specific warnings can
be turned off, but I could not find the feature on gcc...
To keep the gcc compiler noise low when developping, I'll convert all casts using
the following definitions (2 macro/function pairs):

#ifdef JPE_NOLONGCASTWARNING
  static void* jlong2void( jlong ref) {return (void*)ref;}
  static jlong void2jlong( void* ref) {return (jlong)ref;}
# define Jlong2void( ref) jlong2void( ref)
# define Void2jlong( ref) void2jlong( ref)
#else
# define Jlong2void( ref) ((void*)(ref))
# define Void2jlong( ref) ((jlong)(ref))
#endif

That way, the gadzillon warnings will be reduced to 2 warnings, at the expense of
an additional function call...

FG



Sat, 18 Oct 2003 06:46:07 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. ANNOUNCE: JPE, the Java-Python Extension - first beta release

2. JPE 2.0 The Java-Python Extension

3. JPE (Java-Python Extension) V2.0

4. JPE - Java Python Extension Project

5. JPE - Java Python Extension Project

6. JPE: Java - C Python Extension Project

7. JPE (Java-Python Extension) V2.0

8. JPE 2.0 The Java-Python Extension

9. JPE 2.0 The Java-python Extension

10. Announcing the first beta release of the Technical Analysis Library

11. ANNOUNCE: tkpvm1.0b1. First beta release available now

12. ANNOUNCE: First beta release of Tcl-DP, Version 3.3

 

 
Powered by phpBB® Forum Software