6 ms·
I'm not sure you'd need to introduce new instructions. "user-defined value types", i.e. structs, can already be done today by (ab)using the Flyweight pattern a
by Padding 12y ago
I'm not sure you'd need to introduce new instructions.
"user-defined value types", i.e. structs, can already be done today by (ab)using the Flyweight pattern and storing data (possibly off-heap with RAII rather than GC semantics) in some byte[].
All a JDK-supplied implementation would really need to do is (1) automate/hide all the painful work necessary to set this up and (2) provide syntactic sugar in the form of operators that can directly manipulate members of these types (+fast implicitly inlined implementations of them, specialized on the member types).