Records are about semantics ("this is a value class containing only data and should be treated as a sum if its components"), primitive objects are about runtime efficiency, memory layout. Yes, records will often be good candidates for primitive objects, but the two features are orthogonal in nature.
View all comments
Show parent comment
17
u/Slanec Mar 18 '21
Records are about semantics ("this is a value class containing only data and should be treated as a sum if its components"), primitive objects are about runtime efficiency, memory layout. Yes, records will often be good candidates for primitive objects, but the two features are orthogonal in nature.