Call foreign member functions using Panama
Samuel Audet
samuel.audet at gmail.com
Sun Nov 27 02:46:45 UTC 2022
Anything outside platform ABIs for C is out of scope for Panama. Since
Clang, which is essentially becoming the reference C++ implementation,
and Rust are based on LLVM, something like Sulong is probably the way to
go for that:
https://github.com/oracle/graal/tree/master/sulong
https://github.com/oracle/graal/blob/master/sulong/docs/contributor/INTEROP.md
Samuel
On 11/26/22 15:57, Red IO wrote:
> 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
More information about the panama-dev
mailing list