Binder prototype (aka. javaffi)
MacGregor, Duncan (GE Energy Management)
duncan.macgregor at ge.com
Thu Dec 31 19:25:22 UTC 2015
That looks extremely impressive, well done to both of you.
On 24/12/2015, 20:15, "panama-dev on behalf of Mikael Vidstedt"
<panama-dev-bounces at openjdk.java.net on behalf of
mikael.vidstedt at oracle.com> wrote:
>
>All,
>
>This year Santa brings a prototype implementation of the binder!
>
>For some time now I and Henry have been working on a prototype of the
>binder, gluing together jextract (aka. "the groveler") with Vladimir's
>linkToNative functionality. The TL;DR of this is that with this
>prototype code we can now run the canonical test cases like getpid,
>printf (varargs) and qsort (callbacks), as well other complex function
>types.
>
>Some disclaimers to set the mood:
>
>The functionality in this prototype is in no way complete, nor is it
>stable. The implementation work has been focused exclusively on the sysv
>x64 ABI, meaning linux, osx and solaris only. Also, while the prototype
>does support enough types and function prototypes to hopefully make it
>interesting to look at and play around with, it is by no means providing
>complete support for all type marshaling, especially not for callbacks.
>If you actually run it you will also find that it can crash the VM
>relatively easily, so don't start putting this in production quite yet. :)
>
>All that said, one of the most interesting test cases we have working is
>using the prototype binder for jextract itself - for binding the
>libclang API. The API includes functions with struct-by-value arguments
>and callbacks, so having it working is a good proof point that we've
>moved beyond the typical "simple" canonical examples. Not to mention the
>fact that it's fun to have a real world use case to work on.
>
>
>I was hoping to have this in shape to push to the panama forest this
>week, but I'll need a few more days to get everything in place.
>Meanwhile, please have a look at the webrevs below and let me/us know
>what you think. Of specific interest may be the files in the jdk webrev
>under src/demo/share/panama/Panama. These "demos" outline roughly how
>this may be used, though spelling and exact syntax *will* change.
>
>Webrev (top dir):
>https://urldefense.proofpoint.com/v2/url?u=http-3A__cr.openjdk.java.net_-7
>Emikael_webrevs_panama_javaffi-2D20151224_webrev.00_top_webrev_&d=CwICaQ&c
>=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI&r=aV08z5NG4zOHLhrrnNlp8QUqO3q
>oRJCN9uQ9bkMSeqE&m=1gyS11tNmaEk3Ey6mn0Bwv_G5s8_O_hkclfnq7ASvHQ&s=9Snezuw4T
>o7T7xWoiwA4JFYemw_PAfqCT6W3vkd7fjY&e=
>Webrev (jdk):
>https://urldefense.proofpoint.com/v2/url?u=http-3A__cr.openjdk.java.net_-7
>Emikael_webrevs_panama_javaffi-2D20151224_webrev.00_jdk_webrev_&d=CwICaQ&c
>=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI&r=aV08z5NG4zOHLhrrnNlp8QUqO3q
>oRJCN9uQ9bkMSeqE&m=1gyS11tNmaEk3Ey6mn0Bwv_G5s8_O_hkclfnq7ASvHQ&s=OIUzo_V5i
>wdZ4MjBc974pxAi06WVTitU70-CW3ajpTs&e=
>Webrev (hotspot):
>https://urldefense.proofpoint.com/v2/url?u=http-3A__cr.openjdk.java.net_-7
>Emikael_webrevs_panama_javaffi-2D20151224_webrev.00_hotspot_webrev_&d=CwIC
>aQ&c=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI&r=aV08z5NG4zOHLhrrnNlp8QU
>qO3qoRJCN9uQ9bkMSeqE&m=1gyS11tNmaEk3Ey6mn0Bwv_G5s8_O_hkclfnq7ASvHQ&s=4S2Sl
>-2a_kez7kLUr0m3wFp4s2CBeIpAaL5Eh3V2zAs&e=
>
>Happy holidays!
>
>Cheers,
>Mikael
>
More information about the panama-dev
mailing list