Use cases of references wrt value types?

In the community live stream, it was mentioned that references allow one to extend the lifetimes of values and prevent unnecessary copies. I can see their usefulness wrt reference, non-copyable and/or non-movable types, but because Mojo has mutable value semantics, references seem unnecessary for value types. One can just move a value in order to extend its lifetime. About the "preventing unnecessary copies" part, I thought the compiler would optimize those away anyways? There's a lot of work done in Hylo and Swift to make value semantics as efficient as possible, and I thought Mojo would follow them, seeing how it leans heavily into value semantics. From the manual:
In Mojo, we want to provide full value semantics by default
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server