Hacker News new | ask | show | jobs
by zozbot234 1301 days ago
You can opt into runtime checking in Rust via interior mutability. Cell<>, RefCell<>, Rc<>, Arc<>, Mutex<>, Rwlock<> are constructs that involve varying levels of runtime checking - most of these will be way more efficient than GC. It's even simpler to use .clone() in order to effectively do away with any requirement for linearity.
1 comments

(Cell<T> doesn’t actually do runtime checking)