3 ms·
In C you find - types of varying width (how big is an int?). Rust solves that - null terminated strings. Rust's are saner - what happens in an overflow? What
by sharikous 5y ago
In C you find
- types of varying width (how big is an int?). Rust solves that
- null terminated strings. Rust's are saner
- what happens in an overflow? What are implicit casts? Rust clarifies those edge cases
- standard libraries often use NULL to signal error, no actually -1, no actually non-NULL. Rust has Result
And I haven't even scratched the surface...
All those cases are pretty basilar and happen everywhere. For me it's clear that C is much more complex than Rust if you think about the edge cases. All those safeguards are vital.
But yes, Rust is a much bigger language than C so it won't replace it for really low level, scarce resources tasks. For that look at Zig