3 ms·
I haven’t read that much on Rust, but that should be pretty much it. Swift has an emphasis on value types, which often are stored on the stack, but only up to
by manmal 4y ago
I haven’t read that much on Rust, but that should be pretty much it.
Swift has an emphasis on value types, which often are stored on the stack, but only up to a certain size. Copy-on-write makes this feasible - often, those value types are passed by reference until a write actually occurs, but that’s opaque to the dev.
Value types can have pointers to reference-counted types - if a value type is passed/copied, any pointer it owns is retained (weirdly enough, they claim that value types have no „lifetime“, but at some point those refs have to be released - we just have to trust the compiler in this).