4 ms·
> Rust has C-like pointers, so if you're OK with them, you can just use them as if you were writing a C program. This would not be practicable. Raw pointers in
by rom1v 7y ago
> Rust has C-like pointers, so if you're OK with them, you can just use them as if you were writing a C program.
This would not be practicable. Raw pointers in Rust are (probably on purpose) far less convenient to use (no operator + or -, not possible to index an "array" with operator []…).
Moreover, you would lose all benefits provided by slices (iterators, etc.). And locally converting raw pointers to references just to call these methods could lead to undefined behavior (aliasing of mutable references is forbidden even in unsafe code, see https://stackoverflow.com/questions/54633474/is-aliasing-of-mutable-references-correct-in-unsafe-code https://stackoverflow.com/questions/54633474/is-aliasing-of-...).
IMO, using C-like pointers for a whole Rust application would make no sense (it would be worse than just writing a C application).