Making native calls from the JVM

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Wed Dec 17 11:17:45 UTC 2014


Samuel,

 >> P.S. A good HTML rendering is here:
>>    http://cr.openjdk.java.net/~jrose/draft/native-call-primitive.html
>>
>
> Thanks for writing down your thoughts! Always interesting to hear about
> what's happening on that front.
>
> I appreciate how problematic it can be to call efficiently native C
> functions, but I'm still wondering where C++ fits in all this. The way I
> see it, when needing to call some C++ function, we are still going to
> have to write wrappers manually in C, so in that case I fail to see the
> advantage libffi and JNR have over plain old JNI. Any thoughts about that?
JNR provides an API to write native function bindings purely in Java. 
The library takes care of all housekeeping needed to support native 
calls. In Project Panama, a special tool (called jextract [1]) for 
native header file import is considered. It should make Java and native 
code co-evolution much simpler to manage.

Best regards,
Vladimir Ivanov

[1] https://blogs.oracle.com/jrose/entry/the_isthmus_in_the_vm


More information about the panama-dev mailing list