5 ms·
FWIW both Swift and Rust have had value types and generics that abstract over unboxed values since the start.
by slavapestov 3mo ago
FWIW both Swift and Rust have had value types and generics that abstract over unboxed values since the start.
- gf000 3mo agoNot sure I would call them the same - not too familiar with Swift but for rust you probably mean types implementing the Copy trait? But Java's value types are a higher level semantic feature, these objects may do a Copy or a Clone based on heuristics. So probably not the exact analogue but of course rust being a lower level language it can express where and when memory is allocated.