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 24!
• https://jdk.java.net/24/
• Subscribe to panama-dev@openjdk.org 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

From native code gems to Java treasures with jextract

  • 1.
    From native codegems to Java treasures with jextract
  • 2.
  • 3.
    What problem dowe 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
  • 4.
    Foreign function andmemory API workflow
  • 5.
    Automate generating FFMbindings with jextract
  • 6.
    Let’s see itin action!
  • 7.
    A substrate fornative access in the JVM
  • 8.
    Foreign function andmemory API adoption
  • 9.
    Useful links • Trythe FFM API in JDK 24! • https://jdk.java.net/24/ • Subscribe to panama-dev@openjdk.org 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