3 Questions about unsigned numeric primitives and Valhalla

Would expect that, but correct this reasoning if you found an issue

At the beginning of the talk Goetz mentions identity is required for mutability, which requires a known memory location and pointers

Value classes have no identity, they are immutable, they are not referencing or pointing to something but storing the actual value,

Having said that, comparision using references (as in java classes) for value classes sounds a little akward, because there may not be references for internal data, it’s a flattened data layout in memory on Valhalla, and if comparision is not by reference i don’t see what can else be but by value, you need something physical to compare, in other words it can be bitwise pointer or bitwise value, but it’s always bitwise for any type of comparision, let me know if there is a better way to reason about this.

yes by state reference, but valhalla seems to me like state value

1 Like