8 ms·
Your C implementations lacks "buffer bounds". C by itself doesn't. There is nothing stopping a C implementation tracking the size of the data that a pointer poi
by dependenttypes 6y ago
Your C implementations lacks "buffer bounds". C by itself doesn't. There is nothing stopping a C implementation tracking the size of the data that a pointer points to (and these implementations are not even hypothetical, they actually exist right now).
> hence it would be backward incompatible
Rust is backward incompatible with C. A C implementation with fat pointers would not be backward incompatible with C. Depending on how it was implemented it could be ABI-incompatible with older C implementations but this is not necessary either.
- pirocks 6y agoThe problem fat pointer based implementations are massively slower. Rust aims to provide safety without massive performance penalties. If one wanted safety without performance they would just use java or similar.
- dependenttypes 6y ago> The problem fat pointer based implementations are massively slower I am challenging that. I do not believe that a C implementation that uses fat pointers needs to be any slower than Rust. > If one wanted safety without performance they would just use java or similar. Or C with a safe implementation.
- steveklabnik 6y agoYeah like, rust also uses fat pointers. They should be equivalent. The issue is pervasiveness not speed.