From native code gems to Java treasures with jextract

AnaMariaMihalceanu1 192 views 9 slides Oct 06, 2024
Slide 1
Slide 1 of 9
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9

About This Presentation

When developing a Java application, there can be use cases when you need access to system-level APIs and libraries written in other programming languages ( C, OpenGL, Tensorflow, Rust, Python, etc.). Project Panama is designed to facilitate access to native libraries, particularly those developed in...


Slide Content

From native code gems to Java
treasures with jextract

Hello! I am Ana

What problem do we aim to solve?
System APIs (Bluetooth, USB)
Machine Learning (ONNX, Tensorflow)
Off-CPU computing (Cuda, OpenCL)
Graphics processing (OpenGL, Vulkan, DirectX)
Others (CRIU, fuse, OpenSSL, V8, ucx)
can be

Foreign function and memory API workflow

Automate generating FFM bindings with jextract

Let’s see it in action!

A substrate for native access in the JVM

Foreign function and memory API adoption

Useful links
•Try the FFM API in JDK 23!
•https://jdk.java.net/23/
•Subscribe to [email protected] and send feedback!
•Generate FFM bindings with the jextract tool
•https://jdk.java.net/jextract/
•jextract guide: https://github.com/openjdk/jextract/blob/master/doc/GUIDE.md
•Checkout examples:
•jextract samples: https://github.com/openjdk/jextract/tree/master/samples
•Calling a rust library with the Panama FFI
•Build the latest version of the FFM API & jextract
•https://github.com/openjdk/panama-foreign
•https://github.com/openjdk/jextract