Maurizio Cimadamore introduces Project Panama, explaining how it replaces JNI to allow Java applications to safely call native code.
Subscribe to Devoxx on YouTube @ bit.ly/devoxx-youtube
Like Devoxx on Facebook @ facebook.com/devoxxcom
Follow Devoxx on Twitter @ twitter.com/devoxx
Project Panama re-imagines the way in which Java applications speak to foreign functions and data structures. With Panama, developers translate existing native headers into suitable Java interfaces using a tool called “jextract”. These interfaces can then be bound to the corresponding native methods and data structures on the fly, with no need to write platform-specific code in C or C++. Allowing platform-specific idioms to be coded directly in Java not only improves developer productivity, but it also makes the platform more secure and efficient. This talk takes a peek under the hood of Panama with a particular focus on the challenges of providing foreign interoperability support which is as expressive as is efficient.
Maurizio Cimadamore
From Oracle
Maurizio Cimadamore is a compiler engineer who has been working in the language and tools team at Oracle (and, previously, Sun Microsystems) for the last 11 years. Over the years he has contributed to many features of the Java Programming Language, such as diamond inference, lambda expressions and local variable inference.
Why it's here
1 person recommends this
What people say. Recommended as an excellent deep dive into Project Panama and how it simplifies native interoperability in Java.
Moments people linked to
m
u/markehammonsin r/scala • Recommends
Wayland McWayface (a simple wayland compositor) for the JVM
I have implemented the wayland mcwayface tutorial wayland compositors by Drew DeVault using OpenJDK's project panama's experimental foreign interface and jextract tool.
If you're not aware, there's a few new experimental technologies under development for openjdk:
* Panama: a new foreign function interface, interface generation tool jextract, simd intrinsics for java, etc
* Loom: Fibers, continuations, and tail recursion for the JVM
* Metropolis: The jvm rewritten in java
* Valhalla: Value classes, reified generics for primitives
In this scala project, I made use of the new jextract and foreign interface tools provided by projec…
On “Java 10 Panama Project - port JNI solutions to Panama”
The JNI format is as follows:
Java -> JNI glue-code library -> Native code
One of the goals of project panama is to remove this middle layer and get:
Java -> Native code
The idea is that you can use a command line tool to process a native header ( .h ) file to generate a Java interface for calling the native code, and the JDK code will do the rest at runtime as far as connecting the 2 together goes.
If your current JNI code does a lot of stuff in this glue-code layer, then that might have to be re-written on the Java side when porting to panama. (this depends on how much could be done automatically by the used interface extraction tool).
But if you are using something like JNA or…