Unsigned Integers
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Mon Jan 4 11:42:49 UTC 2021
On 01/01/2021 22:24, Ty Young wrote:
> I don't remember if anyone has said Valhalla is an absolute
> requirement for Panama to be shipped, I only remember it being said
> that it can benefit in regards to reducing the memory cost of
> MemoryLayout types. If current Panama is wired so that an unsigned
> byte is actually a short(as they are with VarHandles, IIRC) could
> Panama even change it in the future without breaking backwards
> compatibility, assuming Panama is released before Valhalla? The same
> could be asked about a high level API too I think: if the lower level
> parts of Panama are shipped first and a higher level API is worked on
> after the fact then what happens if some major API issue is found in
> the lower level parts(MemoryAddress/MemorySegment)?
Valhalla is NOT a requirement for Panama to ship.
We can update what jextract generates w/o breaking compatibility (of
course to get better Valhalla-ized API you might need to re-extract, or
maybe there is some flag). In other words, I see a more direct
relationship between Valhalla and jextract than I see it between
Valhalla and the core low level memory access/linker APIs.
>
>
> I thought for the longest time that the Java only memory access parts
> of Panama was going to be shipped first, then ABI, jextract, maybe
> some high level API if it's deemed necessary/possible, and finally
> non-C APIs but the java memory access parts and the ABI have been
> mixed in a single repository and the old ones abandoned.
The memory access part is the most mature, true - but it does not exist
in a vacuum. We wanted to have a round of incubation including both,
because it's very likely that uses of the memory access coming from the
foreign function side of things are very different from usages of the
memory access API in isolation (which are likely similar to what you
would do with the ByteBuffer API). And we need to get both side of the
interaction right. So, in terms of how APIs might be _finalized_ you
might well see the memory access being finalized earlier than the linker
API.
Since now both APIs are integrated into upstream 16, it simply didn't
make a lot of sense to keep having two panama branches for the different
APIs. We already explained all this here:
https://mail.openjdk.java.net/pipermail/panama-dev/2020-December/011499.html
Maurizio
More information about the panama-dev
mailing list