Overview
Explore the evolution of foreign function interfaces in Java in this 31-minute conference talk from FOSDEM'22. Dive into the new Foreign Function & Memory API introduced in Java 17, comparing it with existing solutions like JNI, JNA, and JNR-FFI. Examine the potential of this incubator API to replace JNI, addressing security concerns and modernizing Java's approach to interacting with native code. Learn through practical demonstrations, including implementations of getpid using both JNI and Project Panama. Gain insights into performance implications with presented benchmarks and understand the current state of Project Panama. Whether you're a Java developer interested in native code integration or curious about the language's future direction, this talk provides a comprehensive overview of Java's foreign function capabilities.
Syllabus
Intro
Foreign Function Interface (FFI)
Java Native Interface (JNI)
Java Native Access (JNA)
Java Native Runtime (JNR)
Foreign-Memory Access API
Foreign Linker API
Foreign Function & Memory API
getpid with JNI
getpid with Panama (2 ways)
O Benchmark on OpenJDK 17
O Project panama current state
Taught by
Okta