experiments in panama code generation

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Feb 7 16:18:50 UTC 2022


On 06/02/2022 02:38, Michael Zucchi wrote:
> Structures and unions are similar.   Classes are typed holders of 
> MemorySegment and have normal java getters and setters, anything can 
> be renamed to be more java-like, fields can be excluded if they're 
> private or not useful, can be read/write and indexed acceess is 
> optional.  It's quit a pity you can't implement Addressable as it 
> would just be so much tidier than having to reimplement the same thing 
> for the same purpose but in an incompatible way. 

Actually, we did some back and forth on this. There is no reason as to 
why Addressable could not be unsealed. I had in mind cases where structs 
would want to implement this - but then when reviewing it was decided it 
was better to start tighter and relax later on as required.

Your use case seems to be similar to what I had in mind - and seems a 
good argument towards opening up Addressable.

Maurizio



More information about the panama-dev mailing list