Тёмный

Project Panama - Foreign Function & Memory API  

Java
Подписаться 179 тыс.
Просмотров 9 тыс.
50% 1

Presented by Maurizio Cimadamore - Compiler Architect (Java Platform Group - Oracle) during the JVM Language Summit 2023 (Santa Clara CA).
Try the preview FFM API in JDK 21
➱ jdk.java.net/21/
Subscribe to panama-dev@openjdk.org and send feedback!
➱ mail.openjdk.org/mailman/list...
Prepare for the final FFM API in JDK 22
➱ jdk.java.net/22
➱ openjdk.org/jeps/8310626
Generate FFM binding with the jextract tool
➱ jdk.java.net/jextract/
Build the latest version of the FFM API & jextract
➱ github.com/openjdk/panama-for...
➱ github.com/openjdk/jextract
More information on Panama
➱ inside.java/tag/panama
Make sure to check the • JVM Language Summit 2023 playlist.
Tags: #ProjectPanama #Java #JVMLS #OpenJDK

Наука

Опубликовано:

 

20 авг 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 10   
@SourabhBhat
@SourabhBhat 11 месяцев назад
I was pleasantly surprised by the ease of use of preview version of FFM api in JDK20 with a fairly large C library. The jextract makes it quite straightforward. The only challenge I faced was with double pointers (i.e. passing address of pointer to C functions).
@piyushkatariya1040
@piyushkatariya1040 11 месяцев назад
definitely useful for all kinds of Databases and Big data tools built in all JVM languages
@augustoferrarini
@augustoferrarini 6 месяцев назад
Very promising
@CraccaHacka
@CraccaHacka 8 месяцев назад
This sounds good in practice, I'm using it with a C library, and it's pretty good... But there are downsides compared to JNI that are not explained here, it's not all sunshines and roses. It is limited to C, everything else is unclear. I mean, JExtract for sure works only with C headers, what I don't understand is whether the API can work with C++/Rust/Others libraries. With Rust, it's even more complicated. Rust doesn't have headers, so to generate one it's needed the usage of 'cbindgen' which requires functions to be written/annotated in a certain way in order to be exposed. So, for C++/Rust, the only way is to create wrappers? But then JNI is much easier in such situations, so, what's the point of Panama exactly? I'd really appreciate it if anyone from the Project Panama team could shed some light on my doubts Like, I understand that those languages are much more complicated than C. But in the next releases JNI usage is going to be restricted, because we are meant to use the new half backed FFM API? If JNI can do more, and more easily even, what's exactly the point of Panama Edit: great, I just found out another flaw of this API. Long on Windows and Linux have different sizes, which makes any MemoryLayout which has longs dependent on the OS. Screw the 'compile once run everywhere' I guess
@Adowrath
@Adowrath 8 месяцев назад
The issue, as far as I can tell, with Rust/C++ and such, is that they mangle names. They modify signatures. Unless annotated, of course (like `extern "C"` in C++), because C is the only base platform with precisely defined conventions that can be relied upon for that. If your C++/Rust library doesn't do the stuff you mentioned, they're not usable from C (or from each other, afaik) either - Java cannot realistically magically eliminate that need.
@msx80
@msx80 11 месяцев назад
In all these examples, it's the java program that starts first and call native functions. Is there any provision in Panama for incorporating a jvm into a native program? Something like the old JNI invocation API, which, if i remember correctly, is still kind of buggy?
@user-qw3zc1jr6f
@user-qw3zc1jr6f 11 месяцев назад
I have a question on a similar theme. What happens when the upcall stub is called from a native (non-java) thread? Is this thread attaching to the jvm, or is there an error?
@alcar32sharif
@alcar32sharif 11 месяцев назад
I hope it will not take so many years until the release 1.0
@JoeMwangi
@JoeMwangi 11 месяцев назад
There are some limitations that might have to wait for Valhalla.
@zmitrokz
@zmitrokz 11 месяцев назад
GA or GTFO! Much love ❤ no hate but please hurry
Далее
A Classfile API for the JDK #JVMLS
51:48
Просмотров 14 тыс.
БАТЯ И ТЁЩА😂#shorts
00:58
Просмотров 3,4 млн
ВОТ ЧТО МЫ КУПИЛИ НА ALIEXPRESS
09:35
Просмотров 475 тыс.
Project Lilliput - Compressed Object Headers #JVMLS
51:26
Foreign Function and Memory API by Per Minborg
15:51
Просмотров 2,3 тыс.
Java 21… and Beyond
48:30
Просмотров 23 тыс.
Value Objects in Valhalla #JVMLS
51:42
Просмотров 15 тыс.
Java 21 new feature: Virtual Threads #RoadTo21
33:35
Просмотров 59 тыс.
GraalVM Native Image - Faster, Smarter, Leaner
46:12
Просмотров 13 тыс.
Java's G1 Garbage Collector
25:55
Просмотров 14 тыс.
Крупный ПРОВАЛ Samsung
0:48
Просмотров 660 тыс.
НЕ БЕРУ APPLE VISION PRO!
0:37
Просмотров 345 тыс.