4 ms·
safe Rust isn't just the borrow checker, it's also: - no uninitialized memory - clone vs copy semantics as part of the type system - Send, Sync, "fearles
by xvedejas 3y ago
safe Rust isn't just the borrow checker, it's also:
- no uninitialized memory
- clone vs copy semantics as part of the type system
- Send, Sync, "fearless concurrency"
- no unchecked indexing
- type safety (you can't just cast things like in C)
I do think these are clear complements to a borrow checker, since it's all in the interest of preventing undefined behavior. Yet, there are even more nice modern features of Rust that C lacks:
- hygienic macros
- namespaces
- pattern matching
- modern build/package system
- jraph 3y agoGood point.
- carlmr 3y agoAlso proc_macros. Often Rust ends up easier to read than Python due to proc_macro abstractions, too. Serde is a great example for this. Rust is really high-level when you use it correctly. And I rarely need lifetime annotations. Which is especially easy if you write in a somewhat functional style.