Making native calls from the JVM

Henry Jen henry.jen at oracle.com
Wed Dec 24 20:11:49 UTC 2014


On 12/20/2014 04:48 PM, Samuel Audet wrote:
> Hello, Vladimir,
>
> On 12/17/2014 08:17 PM, Vladimir Ivanov wrote:
>> 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
>
> Yes, I had read that blog post before as well. So, I guess I can
> reformulate my question in terms of jextract. In the case of C++, given
> that JNR was not designed to support C++, what would JNR offer to
> jextract that JNI does not already offer?
>

jextract is a tool parsing the header file, which will be able to 
support C/C++. We will need a mechanism to describe object layout based 
on information collected from jextract and thus can properly access the 
data and function.

It's still early to say what will end up to be, JNR offers a way to bind 
Java API to native API without the need to write native code as JNI, I 
think that's the goal of project panama, trying to minimize(if not to 
comletely eliminate) the need to write native code and give JVM the 
opportunity to optmize the call into native APIs.

Cheers,
Henry


More information about the panama-dev mailing list