Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There is however a downside to the „clone everything“ approach: The performance might get worse than what it would be in an optimized GCed language that doesn’t require cloning (eg C#/Java).

At least I would only reach out for Rust at the moment for performance critical code, and then don’t leave easy optimizations on the table due to lifetimes.



There are other solutions (like Rc<RefCell<T>>) that allow you to avoid cloning as well if you still don't want to deal with lifetimes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: