Growing jextract
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Fri Feb 16 16:43:50 UTC 2024
Hi Cristoph
On 16/02/2024 16:14, Christoph Läubrich wrote:
> Hi Maurizio,
>
> that sounds interesting, jextract is really a very useful tool, so
> maybe its a good opportunity to ask will it be part of the standard
> jdk distribution one time so one don't need to download it separately?
At the moment we do not have plans to release jextract as part of the
JDK. Part of the issue is logistics - e.g. libclang is fairly sizeable,
and would increase the size of the JDK for what some might consider a
"niche" case. Part of it is that we'd like to assess how frequently the
tool will need to change (e.g. because of changes in libclang, C
standards, or both) before we make a decision in that direction.
What we plan to do is to release the jextract's jmod, so that jextract
can at least be linked into a custom JDK image (with jlink).
>
> I also wonder now that it will become final in 22, will there be some
> kind of --release flag so one can generate code that is compatible
> with Java 21 and 22 (e.g. only using API that has not changed?), maybe
> even if the API evolves in later versions? or will one always need to
> make sure our self in some ways?
We'd rather not go down that path. There will be branches for the
version required (and corresponding binary snapshots). We'd like for
jextract to follow the Tip & Tail model (e.g. push all the code in the
latest branch, backport stuff where needed to other branches).
Cheers
Maurizio
>
> best
> Christoph
>
>
> Am 16.02.24 um 16:50 schrieb Maurizio Cimadamore:
>> Hi,
>> with JDK 22 near us, we have spent some quality time with jextract,
>> to make sure the code it generates is as good as it can be ahead of
>> the finalizaton of the FFM API. This resulted in several changes,
>> both in the implementation (so, invisible to jextract users) and in
>> the generated code, as we cleaned up the translation strategy to
>> better adhere with the core principles behind the jextract tool.
>> These changes are captured in details in this document:
>>
>> https://cr.openjdk.org/~mcimadamore/panama/jextract_changes.html
>>
>> It might be a good time to take the latest jextract for a spin (using
>> your favourite C library!) and report back, in case we missed
>> anything. You can find the latest sources in this branch:
>>
>> https://github.com/openjdk/jextract/tree/panama
>>
>> Binary snapshots of this newer version are also available here (note
>> that MacOS/Arm64 builds is also supported now):
>>
>> https://jdk.java.net/jextract/
>>
>> Cheers
>> Maurizio
>>
More information about the panama-dev
mailing list