Bare metal Java
summary
Stable-ish Java 17 incubator APIs let Java allocate and bound native memory with MemorySegment and ResourceScope and create safe varhandles for atomic and volatile native access; the C linker produces downcalls/upcalls (example: getpid and installing a POSIX signal handler) and requires explicit unsafe/module permissions. A native SDL game engine built with generated bindings runs, and a POSIX mq demo sends/receives messages, showing jextract auto-generates most bindings (jextract auto-generates bindings) and the MVP targets x86_64 C libraries only.
AI-written summary · about
chapters (13)
- 0:00Introduction and context
- 4:48Why Java needs bare metal APIs
- 14:45Native memory access in Java
- 24:03Working with memory segments
- 33:15Var handles and memory access
- 44:16Memory layouts and C interop
- 55:36Foreign functions and JNI alternatives
- 1:01:47Calling C from Java
- 1:17:28Demo: Java game engine with SDL
- 1:34:19Demo: Game implementation
- 1:40:19Demo: POSIX queues in Java
- 1:45:26Performance and future plans
- 1:49:08Q&A and closing
