Panama/foreign EA - May 2021

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri May 21 20:53:46 UTC 2021


As things stand, jextract does not support C++.

There are mechanical ways (more or less) to derive a C wrapper library 
around C++ libraries - we did some experiments in this area, but we got 
blocked mostly on templates - not because they can't be done, but simply 
because the clang API we use for jextract doesn't seem to expose 
information about template classes/methods in a way that is friendly to 
tools - very similar C++ programs end up with information scattered in 
very different places in the clang AST, and that was a source of 
constant frustration. We also had some issues more on our end, as 
jextract was running out of memory when trying to process big C++ 
libraries in this way.

I believe at some point we will make another attempt, perhaps by trying 
also to contribute some patches back to the libclang API (I see some of 
the problems we have encountered also mentioned by other tools, such as 
Rust's bindgen). It is also an area were we'd be happy to accept some 
contributions :-)

Cheers
Maurizio

On 21/05/2021 21:28, Jason Lee wrote:
> Apologies if this is not the correct place for this, but I'm interested in
> wrapping/exposing a C++ library, but I'm not finding much information on
> C++ support other than some hints that it should work. Is C++ currently
> supported? If so, could someone direct me to any resources on the topic?
>
> Much appreciated!
>
> On Wed, May 19, 2021 at 4:26 PM Maurizio Cimadamore <
> maurizio.cimadamore at oracle.com> wrote:
>
>> Hi,
>> We have just released another early-access Panama/foreign build, which
>> includes all the goodies we've been working on so far, from API changes,
>> to VM upcall optimizations, to jextract stability/usability improvements.
>>
>> Keep the feedback coming - we couldn't do this without your help and
>> support.
>>
>> Cheers
>> Maurizio
>>
>>


More information about the panama-dev mailing list