A Promising Future for using Native Libraries in the Java World
summary
Project Panama replaces handwritten JNI glue with a generated Java API that uses the foreign memory access API (safe, bounds-checked segments/addresses/layouts) and the foreign function support API (C‑linker producing native method handles for downcalls and upcalls). The jextract tool auto-generates a ready-to-use JAR (example: five Java sources for the Cairo demo) so Java calls native Cairo without native wrappers, works on Linux/Windows x86 early access, and targets JDK16/17 incubator release. va_list support handles varargs.
AI-written summary · about
chapters (21)
- 0:00Einleitung
- 0:31About the Speakers
- 10:44ByteBuffer
- 12:00Goal of Project Panama
- 12:24Components of Project Panama
- 12:52Foreign Memory Access Support API
- 13:42Main Abstractions of Foreign Memory Access
- 14:37MemorySegment: Example 1
- 16:17MemoryAddress: Example
- 16:58Memory Layout? Represents the layout of data in the MemorySegment
- 17:30Memory Layout: Example Part 2
- 19:05Example Accessing data in memory
- 19:53Further Reading: Foreign Memory Access
- 20:11Foreign Function Support Introduces method handles that targets a native function
- 22:12FunctionDescriptor and MethodType
- 23:09CLinker Downcalls: Call C from Java
- 24:19CLinker Upcalls: Call Java from C
- 27:59Panama Workflow
- 28:43How to run jextract?
- 29:28What is generated by jextract?
- 30:23cairo_h.java (inside cairo.jar)
related talks
01h 04mProject Panama Unleashing Native Libraries
29mEasily Leverage Native Functions with Project Panama from Java
43mPanama Update
43mProject Panama’s Foreign API
33mFrom native code gems to Java treasures with jextract
55mJava 19 Project Panama 4 Newbies
55mBare metal Java
49mCalling Native Methods Without JNI Overhead
