Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static JNI #174

Closed
sgammon opened this issue Jun 11, 2024 · 2 comments
Closed

Static JNI #174

sgammon opened this issue Jun 11, 2024 · 2 comments

Comments

@sgammon
Copy link

sgammon commented Jun 11, 2024

Heya @ajalt,

We at Elide use Mordant and soon will be using Clikt (thank you for your hard work!) to drive our CLI. However, we end up with a bunch of FFM, JNI, and JNA options at runtime, across all these different libraries. I know you have worked hard to thin the JNA requirement for Mordant, and along those lines, we have come up with a technique to make JNA easier, more reliable, and perhaps more performant by avoiding the initial library unpacking step altogether, at least for users building native via native-image.

Would you be open to adopting in Mordant should this linked PR get merged? If so, would you be open to helping review and test? JNA is a sensitive project and I am literally terrified contributing to it 😅 , so I am hoping to gather strength in numbers. Hopefully, if JNA over static JNI can improve startup speed for a lot of apps, then we can get it properly reviewed/vetted and merged.

Thanks either way for your awesome libraries. We really love using them!

Sam

@ajalt
Copy link
Owner

ajalt commented Jun 11, 2024

Thanks for the kind words! Your technique certainly looks interesting, but mordant uses graal's FFI directly for native-image. JNA is only used for regular JVM execution, so I don't believe that your change affects this library.

As an aside, the plan is to eventually add an FFM implementation so that JNA can be optional unless you're running on an old JDK.

@sgammon
Copy link
Author

sgammon commented Jun 12, 2024

@ajalt No worries :) thanks for the response and for your awesome libs.

@sgammon sgammon closed this as completed Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants