I did some research today into alternatives to GDirect. Time to
do a little more hacking on it, I suppose.
I’ve been talking to the NativeCall guys for a
little while, hoping to convince them to take a more GDirect-like
route. Their approach is more like Java reflection: construct an
object representing a native call, then use an invoke
method on that object to actually call it. This is a nice idea,
complementary to GDirect’s current approach; I’ll probably add it at
some point. Unfortunately they’re taking the wrong direction
implementation-wise, writing custom inline assembly for each kind of
method call. This will never scale. By way of contrast, even in its
half-baked state GDirect already works on 11 architectures for any
combination of (primitive) arguments and return types. Also, the
reflection-like approach is great when you need to call a native
function in a fairly dynamic way; but GDirect’s current approach is
superior when you want to wrap a native API. Both are probably
needed.
Noodle
Glue sounds really great but, as far as I can tell, is not open
yet. (There are a couple other proprietary libraries in this space
too, like we care.)
JNIDirect is basically a
free version of the non-free inspiration for GDirect. Reading through
the white paper indicates that it has some functionality I hadn’t
thought up yet, so that’s cool. It seems to be Apple-specific, so
that isn’t very interesting.
Jace looks
more like a library to make JNI friendlier. Basically it lets you
write something like CNI that is portable across VMs. That’s pretty
cool (though not exactly what I’m looking for). It would probably be
worthwhile exploring how to make CNI and Jace source compatible.
Be the first to leave a comment. Don’t be shy.