Speaker

Nizar Benalla
Oracle

Nizar Benalla is a Software Engineer in Oracle's Java Platform Group, where he helps evolve the tooling around the Java Language, most notably the Java documentation tool (javadoc), the Java Bindings generator (jextract) and the API comparison tool (apidiff) under the OpenJDK project.

View
Moving the seam between Java and Native code with jextract.
Tools-in-Action (INTERMEDIATE level)

Java applications often need integration with native libraries to access specialized functionality such as Off-CPU computing, graphics processing, machine learning frameworks, or System level APIs. While the Java ecosystem provides numerous powerful libraries, there exist numerous robust, native-only libraries that are not, will not and should not be rewritten in Java. Java's Foreign Function & Memory (FFM) API, finalized in JDK 22, enables Java developers to interface safely and efficiently with native code.

However, creating Java bindings manually using the FFM tedious and error-prone, as one would need to know the layouts of all the native types involved. jextract addresses this challenge by automatically generating Java bindings from existing C headers.

The session briefly illustrates the types of bindings generated by jextract for common C constructs such as structs, nested structs, functions, variadic functions, typedefs, built-in types, and the recommended workflow. It also includes live demos where Java client code uses jextract-generated FFM bindings to interact with native libraries, such as running machine learning inference using ONNXRuntime-genAI and performing GPU-accelerated CUDA nbody simulations using a fully jextracted OpenCL and OpenGL backend.

Participants will leave understanding how jextract allows developers to ""move the seam" between Java and native code.

More

Searching for speaker images...