Fwd: Custom Primitives?

Scott Morgan scott at adligo.com
Tue Feb 22 01:44:51 UTC 2022


Hi All,

   I've been messing around with some data structures / arrays lately and I
am wondering if Java will ever have custom primitives, and if those
custom primitives could contain optional pointers in some way.  I have
found a number of similar things Value Classes,
https://openjdk.java.net/jeps/401
Primitive Value Classes, etc, but I'm really looking for something a little
lower level.

Ideally I would like to store an array (with a single pointer pointing at
it) of one boolean and one optional pointer / reference, in a primitive
array structure to reduce the space of the null pointers.
   However this creates some obvious problems as length of the boolean only
could be one bit and the boolean + the pointer / reference could be 8 bytes
and one bit (on 64 bit JVMs).  Without the fixed length size of the
primitive, I imagine that the mapping to bytes and array indexes would be
quite challenging & slow.  However I have a gut feeling that something like
this path must be possible.

Are there any plans to solve problems like these in the current JEPs?
Is anyone doing similar research?

Cheers,
-- 
Regards,
Scott Morgan
President & CEO
Adligo Inc
http://www.adligo.com
https://www.linkedin.com/in/scott-morgan-21739415
A+ Better Business Bureau Rating
<https://www.bbb.org/chicago/business-reviews/computer-software-publishers-and-developers/adligo-inc-in-chicago-il-88381256>
https://github.com/adligo

By Appointment Only:
1-866-968-1893 Ex 101
scott at adligo.com
skype:adligo1?call
Send Me Files Securely:
*https://www.sendthisfile.com/f.jsp?id=ewOnyeFQM18IDRf7MMIdolfI
<https://www.sendthisfile.com/f.jsp?id=ewOnyeFQM18IDRf7MMIdolfI>*
https://discord.com/
Adligo#3066





-- 
Regards,
Scott Morgan
President & CEO
Adligo Inc
http://www.adligo.com
https://www.linkedin.com/in/scott-morgan-21739415
A+ Better Business Bureau Rating
<https://www.bbb.org/chicago/business-reviews/computer-software-publishers-and-developers/adligo-inc-in-chicago-il-88381256>
https://github.com/adligo

By Appointment Only:
1-866-968-1893 Ex 101
scott at adligo.com
skype:adligo1?call
Send Me Files Securely:
*https://www.sendthisfile.com/f.jsp?id=ewOnyeFQM18IDRf7MMIdolfI
<https://www.sendthisfile.com/f.jsp?id=ewOnyeFQM18IDRf7MMIdolfI>*
https://discord.com/
Adligo#3066


More information about the valhalla-dev mailing list