Bernd wrote:
> Curious: is there any contact between Cygnus and Japhar?
Yes, a little.
> Especially with respect to Per Bothner's "native++" and
> the libjava developed for the gjavac front?
I think you mean gcj not gjavac - although it did have that name once.
The native++ stuff you are talking about it is now called CNI, and is
documented here:
http://sourceware.cygnus.com/java/papers/cni/t1.html
> As in: an EXTension for Japhar that provides a C++ specific/fast
> native code interface? In addition to JNI, which does not have C++
> bindings, just a few inlined conveniences.
This might require significant work. G++ and GCJ provide object-level
compatibility. For instance, from the Java class Foo:
public class Foo
{
public static int aaa;
private static long bbb;
public native void fn1(String a);
public double fn2()
{
return 3.14159;
}
}
A tool, somewhat like javah, can be used to create a header file
containing:
class Foo : public java::lang::Object
{
public:
virtual void fn1 (java::lang::String *);
virtual jdouble fn2 ();
Foo ();
static jint aaa;
private:
static jlong bbb;
};
These are just two faces on the same object in memory.
The main advantages are:
- zero overhead calls between compiled Java and C++ code, and
- direct manipulation of Java instance variables from C++.
You cannot get zero overhead calls between interpreted Java and
compiled C++ code. You'll need libffi, or something like it.
You certainly could aim for direct manipulation of the Java instance
variables. As long as the VM is object compatible with G++ and GCJ it
should be possible to put C++ faces on Java objects.
AG
--
Anthony Green Cygnus Solutions
Sunnyvale, California