<div dir="ltr">Very happy with the Valhalla direction. The design could be reaching global bedrock, if not there already.<div>Just the devil's advocate.<div><br></div><div>Without loss of generality, let's take the familiar with Valhalla, rational number, and model it with a class. We're faced with a few choices:</div><div><br></div><div>1. Value class? Yes.</div><div>2. Implicit initialization? No, we can't have a zero denominator.</div><div>3. Non-atomicity? No, cause 2. is no.</div><div><br></div><div>So we can conclude that Rational is a plain value class and no more (or less should I say).</div><div>Now, let's do the same with a complex number:</div><div><br></div><div><div>1. Value class? Yes.</div><div>2. Implicit initialization? Yes, the zero is valid.</div><div>3. Non-atomicity? Yes, no cross-field invariants.</div></div><div><br></div><div>So, Complex can enjoy everything Valhalla produced. But, why is that? And here is where the temptations rise.</div><div><br></div><div>- From a representation perspective, Rational is a subset of Complex, they are not that different after all.</div><div>- Both will be used in the same context of primitive-like behaviour, with high performance requirements.</div><div><br></div><div>In a perfect world, we would like users to resist those temptations, and model each class in the bucket it belongs to. But, when people are faced with the dilemma of (something) vs. performance, they skew towards the latter, as we've seen with x, y point arrays, object pools, etc...</div><div><br></div><div>It might not be far-fetched to encounter B3 Rational's' out there or whatnot.</div><div>The fewer the obstacles that prevent B3 are, the less of a dilemma it becomes. "Look the other way".</div><div><br></div><div>We want the ratio of all value classes: .filter(shouldn't-B3).filter(modeled-B3) / .filter(shouldn't-B3) to be 0.</div><div>But, what that number might actually be? What's an acceptable threshold? What if it's close to 1?</div><div>Of course, preview features will help us here.</div><div><br></div><div>Another temptation might rise when non-atomicity is valid but default initialization is not, as with Rational.</div><div><br></div><div>Lastly, a Range class should not be non-atomic, but many might model it as such, with the mindset of B3 won't make your broken program broken-er.</div><div><br></div><div>Unfortunately or not, context matters. Not all Range's' are gonna be used with the same level of concurrency, back to use-site vs declaration-site...</div><div><br></div><div>Even though identity-free classes of any bucket bring representational power into the model, people might view Valhalla as a performance marketing term and focus only on that.</div><div><br></div><div>This is more or less of an existential crisis: What if everyone jumps to B3?</div></div><div><br></div></div>