An experiment with Project Panama: Windows TransmitFile

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Nov 23 11:06:39 UTC 2020


Thanks for the report.

I'm happy that hand-writing the various MethodHandle didn't feel too 
painful for you.

Maurizio

On 21/11/2020 16:14, Pedro Lamarão wrote:
> Hi Maurizio,
> I did everything by hand.
> I'm familiar with the Windows API, so, this was a very straightforward 
> process of consulting the API reference and writing the boilerplate.
> To be fair, I didn't actually consider using jextract, or read much 
> about it.
> I think my previous experience with JNA and JNR, and .NET "interop", 
> affected my approach.
> Panama seems pretty intuitive to me.
> Ah, on this point, I had no previous experience with MethodHandles or 
> VarHandles also.
> Regards,
> Pedro.
>
>
> Em sáb, 21 de nov de 2020 09:28, Maurizio Cimadamore 
> <maurizio.cimadamore at oracle.com 
> <mailto:maurizio.cimadamore at oracle.com>> escreveu:
>
>     Hi Pedro,
>     thanks for giving Panama a try - the resulting program is indeed very
>     readable.
>
>     One question (think of it as my personal questionnaire) - what did
>     you
>     use to generate the various linker method handles/layouts? Did you
>     use
>     jextract and then did a manual filtering pass to remove what you
>     didn't
>     want, or did you just manually hand-written the various
>     functions/layouts from Windows.h which were required in your program?
>     Note: there's no good/bad answer, I'm mostly interested in
>     understanding
>     how developers get the job done using the new APIs/tools :-)
>
>     Thanks!
>     Maurizio
>
>     On 21/11/2020 01:27, Pedro Lamarão wrote:
>     > Hello all!
>     > First and foremost, thank you for your excellent work!
>     >
>     > I'd like to contribute an experiment with the foreign linker.
>     > Maybe evaluating such things is useful somehow.
>     > It is a program that calls a specialized Windows API to transmit
>     a file
>     > over a socket.
>     > https://github.com/pedrolamarao/sandbox-jvm-sendfile/tree/panama
>     <https://urldefense.com/v3/__https://github.com/pedrolamarao/sandbox-jvm-sendfile/tree/panama__;!!GqivPVa7Brio!OFqZw42nEOlfdXzaSNeGmSVstoBwAovXsQALfuSyugDpyPkDRudfaurqBSrDW-zsA9YDHPk$>
>     >
>     > I think the result is very readable!
>     > It took me approximately 5 hours to complete this, including
>     studying
>     > Project Panama's technical documentation.
>     >
>


More information about the panama-dev mailing list