Hacker News new | past | comments | ask | show | jobs | submit login

Note that you can drop down to unsafe C-style code in Rust. https://doc.rust-lang.org/stable/nomicon/

Anyone who claims Rust is simple should ensure they thoroughly understand that book.

Another way to "turn off" the borrow checker is to write a scripting language that compiles to Rust which automatically annotates all variables with the longest lifetime possible, and spits out mutable references depending on whether you actually mutate anything.

There's also RefCell, which lets you defer borrow checking till runtime. It's handy for pretending like your references are immutable.




I don't think that anyone's claiming that Rust is objectively a simple language. Simpler than some other languages, certainly, but it's a medium-sized language at best.

Furthermore, unsafe code gives new users a firm boundary of complexity that can be ignored. New to Rust? Don't use the unsafe keyword. Using the unsafe keyword? Read the nomicon first. It's quite useful for onboarding to know that all the C-style UB shenanigans are behind a gate that can be ignored until you're comfortable with the rest of the language.


Also note that none of those things turn off the borrow checker. Which is the point of the article.




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

Search: