4 ms·
> Writing Rust programs (vs. writing C programs) correctly is hard! To be clear: getting Rust programs past the compiler is much harder that C programs: C does
by dbaupp 12y ago
> Writing Rust programs (vs. writing C programs) correctly is hard!
To be clear: getting Rust programs past the compiler is much harder that C programs: C doesn't incorporate much type-system/static checking so a lot more gets past the compilers. But writing truly correct C programs (i.e. don't crash horribly) is a harder task, as there's no computer assistance for avoiding large classes of possible bugs.
> failing to free a pointer is rarely one of them
> we can't be bothered to free our pointers
Solving this "problem" is not the goal of Rust. Rust aims to avoid undefined behaviour by default, e.g. derefencing invalid pointers, use-after-free, iterator invalidation are statically ensured to never happen, unless you opt-in at specific locations via `unsafe`. Cleaning up memory automatically is a nice feature, but the main draw card and the reason Rust might actually be interesting is that Rust offers memory safety without garbage collection.
In any case, I think you're being overly glib about the problems of C: it's so so easy to have a program that exhibits undefined behaviour, and so is theoretically operating with no restrictions.
- ci5er 12y ago> In any case, I think you're being overly glib about the problems of C: In short form, here, without a doubt. > it's so so easy to have a program that exhibits undefined behaviour, and so is theoretically operating with no restrictions. I've run into this. A lot! It was almost always my fault. One notable exception was back when I used to do a fair amount of with GP (Genetic Programming -- evolving large populations of small programs). The system was shockingly adept at finding/exploiting edge-cases and exploiting them for advantage.
- ci5er 12y ago> In any case, I think you're being overly glib about the problems of C: In short form, here, without a doubt. > it's so so easy to have a program that exhibits undefined behaviour, and so is theoretically operating with no restrictions. I've run into this. A lot! It was almost always my fault. One notable exception was back when I used to do a fair amount of with GP (Genetic Programming -- evolving large populations of small programs). The system was shockingly adept at finding/exploiting edge-cases and exploiting them for advantage.