Repository navigation
Myna 0.9.0
Myna 0.9.0
Myna 0.9.0 expands Java 25 FFM (Panama) support for the JVM and Substrate VM, and adds optional static JNI bindings for Substrate VM. The direct Native Image C API remains the primary runtime and performance target. Binding ABI 2 and native value ABI v3 are unchanged.
Adopting the adapters
- FFM
LibraryBindingaccepts an explicitSymbolLookupor library path and caller-owned arena. It supports scalar and by-value record calls, scoped byte-buffer borrows, and consumer-owned resource factories.CriticalLibraryBindingexposes typed critical calls only for imports satisfying the native-leaf contract; normal calls remain available separately. - Scoped upcalls support dynamic Java callbacks, native-thread invocation through shared arenas, and explicit exception sentinels. Declared static targets additionally support direct AOT upcall registration with an
i32ori64status policy. Void callbacks discard uncaught exceptions. By-value record callbacks remain unsupported and are rejected during validation. myna generate INPUT.seam --jni --out generatedemits Java declarations, C wrappers, JNI C/Rust declarations, separate optimizer contracts, and a static-library symbol manifest. Build the wrapper with the pinned compiler and JNI headers, archive it with the native implementation, and retain the generated Native Image resources. Static JNI uses normal JNI transitions; JVM consumers should use FFM.
Regenerate all matching Java, C, Rust, JSON and LLVM outputs together, then rebuild consumers. Generator-versioned canonical descriptors have new fingerprints in 0.9.0, including declared static callback policies. Keep the generated META-INF/native-image resources and the pinned Graal SDK compile-only dependencies. The supported toolchain is Elide 1.6.2, elide-dev/toolchain 2026.11.1 (LLVM 23), and the external elide-dev/graal 25.5.5-elide.24 distribution.
The adapter guide provides the build recipe and exact contracts. Callers own library and callback arena lifetimes. Resource consumers enforce required-thread access, guarded borrows and exactly-once destruction. Static JNI raw addresses require caller-managed lifetime, extent and alignment. Its direct-buffer overloads check liveness and thread accessibility before entry but do not pin an arena against concurrent or callback-driven closure; use FFM borrows when scope acquisition is required.
Correctness and LTO
This release fixes unsigned narrow callback return extension, generated JNI wrapper names that shadow native symbols, and record-result allocator parameter collisions. Runtime fixtures cover carrier conversions, both record ABI classes, callback exception policies, shared and confined resources, failed adoption cleanup, and closed or wrong-thread memory and library scopes on the JVM and SVM.
The LLVM applicator preserves ThinLTO and full LTO input modes, including Rust fat-LTO bitcode. Integration tests link and execute both modes and retain optimized IR, disassembly and hashes. LLVM ELF FatLTO native objects with embedded .llvm.lto sections are a distinct format and remain unsupported; standalone objects and mixed archives containing them fail explicitly.
Validation and performance limits
A one-million-input native value fuzz campaign completed with no findings, including the required ASan, UBSan, leak and RSS expected-failure canaries. CI uses bounded ten-minute campaigns; longer campaigns run separately. These results cover the exercised native value workload, not every generated adapter or ABI signature.
The comparison harness separates generated and handwritten direct SVM normal/leaf calls, FFM normal/critical calls, and static JNI, retaining allocation observations, raw samples, compiler settings, hashes and instructions. Existing scalar measurements do not establish buffer, record, callback or resource performance. JVM measurements remain secondary; a critical-call configuration is not itself evidence of a speedup.
Myna remains dual-licensed under Apache-2.0 OR MIT. The portable value SDK includes the value-reader JAR, Rust crate, C/C++ headers and license texts; it does not imply publication to crates.io or Maven Central. Source archives, container images, checksums, attestations and symbol receipts follow the release verification procedure. macOS Native Image symbols preserve method names, not complete source-level DWARF.