Call foreign member functions using Panama
Red IO
redio.development at gmail.com
Sat Nov 26 06:57:12 UTC 2022
I was building a small framework to connect rust and java (jdk 11) for a
project. I build a java class with 1 field a long. Then I added non static
native functions to the class representing the member functions of the
corresponding rust struct. I mangled myself through the jni nightmare and
stored a reference to the rust struct in the long. This construct simulates
first class foreign member function support pretty well. After building
this I thought about Panama. As far as I know Panama currently only
supports C (no concept of member functions). Wouldn't it be a good idea to
support languages like c++, rust and their member functions? I mean with
Panama we can already create foreign structs. Would it be so far fetched to
integrate constructors and member functions into Panama and jextract?
Great regards
RedIODev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20221126/94a4f4e8/attachment.htm>
More information about the panama-dev
mailing list