|
|
|
|
|
by carlmr
1727 days ago
|
|
>Memory usage was going to be fiddly no matter what they built with. That is true. I do find however the explicitness of the Rust way of dealing with memory, whether it be lifetimes, who can and can't mutate it and who the memory belongs to, makes it much easier to reason about the right way of doing these things. In C++ the same is often possible, but there is no way to have guarantees at the interfaces. Const is a promise that your function won't mutate something, it doesn't put any restrictions on the caller. Pass by reference doesn't guarantee that the reference will be kept alive. Go (I guess with no experience there) probably has fewer footguns, but how explicit is memory management? |
|