Re:Why Discord is switching from Go to Rust
by mcguire on Tuesday February 04, 2020 @06:37PM
(#22242354)
On the other hand, Rust's RAII management model behaves similarly to a reference counting system where the counts are limited to 0 and 1 (well, for a loose approximation of the 0 state), right?
[ Parent
| on HN ]
Re:Why Discord is switching from Go to Rust
by steveklabnik on Tuesday February 04, 2020 @06:44PM
(#22242410)
Some people say this, but I think it's misleading; refcounting can make things live longer, but the borrow checker cannot.
Re:Why Discord is switching from Go to Rust
by Jweb_Guru on Wednesday February 05, 2020 @02:48AM
(#22244814)
Well, with ownership, a move can make things "live" longer, I guess.
Re:Why Discord is switching from Go to Rust
by steveklabnik on Wednesday February 05, 2020 @09:00AM
(#22246731)
You're not wrong. I just think there's enough difference that the analogy doesn't really work.
Re:Why Discord is switching from Go to Rust
by ta20200202 on Tuesday February 04, 2020 @07:06PM
(#22242572)
RAII for references (pointers) is a no-op. If the cache returns references to the data in its own array there is no overhead.