Hacker News new | ask | show | jobs
by steveklabnik 357 days ago
You're a little off.

To put it in Rust terms, the "automatic" means that Swift will insert the equivalent of calls to ".clone()" for you, whereas this is manual in Rust.

1 comments

I see.

My understanding is that Rust doesn't have _automatic_ reference counting as in Swift only because it has an alternative (move), which requires the programmer to specify their intent. The principle is nevertheless the same: ensure every time a reference is copied the ref count is incremented, free only when ref count is zero, and we get temporal memory safety.

It is true that the idea is memory safety in both cases, absolutely.