3 ms·
I think RC and clone are the way people begin to use Rust. While lots of criticism are against this usage for not idiomatic, it should be acceptable. Coming fro
by mrbonner 2y ago
I think RC and clone are the way people begin to use Rust. While lots of criticism are against this usage for not idiomatic, it should be acceptable. Coming from Python, nodejs or Ruby, even RC and clone or stack based variables is still a magnitude faster than those languages. When it's about absolute control for performance you can drop down a notch to the borrow checker behavior.
- mathw 2y agoThat's an interesting perspective I'd not considered before. Maybe there are different "registers" of Rust, in the same sense that linguists talk about registers in human languages, where you use your language differently for different purposes. And thus, maybe if you're writing something that doesn't need to be screamingly fast absolutely all the time there's a register of Rust where putting lots of things in Rc<Box<T>> is completely acceptable, in much the same way that you might use a lot of impolite words around your friends but you don't in front of your employer.
- Philpax 2y agoYou may be interested in https://without.boats/blog/the-registers-of-rust/ https://without.boats/blog/the-registers-of-rust/ :)
- LtdJorge 2y agoI think Rc<Box<T>> could be simplified to Rc<T>.
- scotty79 2y agoI'm gonna plug my Rust "invention" here: Show HN: How to program in Rust as if it was old school C++ with pointers https://news.ycombinator.com/item?id=34067924 https://news.ycombinator.com/item?id=34067924