3 ms·
No, I really wouldn't characterize rust as more trouble than it's worth. Rust exposes low level primitives and is efficient, that's nice and all, but you mostl
by gpm 4y ago
No, I really wouldn't characterize rust as more trouble than it's worth.
Rust exposes low level primitives and is efficient, that's nice and all, but you mostly don't actually think about them when programming non-low-level applications.
What it does force you to think about a lot is it's correctness guarantees. Things like only letting you modify data that no one else currently has a reference to, and things like forcing you to check error conditions by wrapping them behind an "enum" (algebraic data type). Rust is making a tradeoff here between friction in writing code, and the the amount of time it takes to understand code as well as the number of bugs you write.
All in all, for most large programming projects there is no language I think I'd be more productive in than rust. For small scripts, the tradeoff can be less worth it (in which case I tend to use python, or for even smaller ones bash), but those scale poorly to giant projects where you want to be able to do things like refactor without introducing bugs in a file you forgot about.
It happens to be the case that rust maps many of it's primitive types directly to low level types that you can reason about in a low level fashion (e.g. ADTs are tagged unions, references are actually just pointers - maybe with a second vtable pointer depending on the type) - but you don't need to do that unless you're worrying about optimizing the constants for performance or doing terrible hacks with unsafe.
- aloisdg 4y agoOCaml, haskell, Idris, F#...