Re:Implementing tile encoding in rav1e
by rom1v on Friday April 26, 2019 @08:43AM
(#19756830)
> 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-...).
IMO, using C-like pointers for a whole Rust application would make no sense (it would be worse than just writing a C application).
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-...).
IMO, using C-like pointers for a whole Rust application would make no sense (it would be worse than just writing a C application).