4 ms·
Using different enums doesn't help, because C will happily let you cast enum A to enum B implicity. In Rust, I can express an API which can't be used incorrect
by jcranmer 2y ago
Using different enums doesn't help, because C will happily let you cast enum A to enum B implicity.
In Rust, I can express an API which can't be used incorrectly. In C, I can't. Sometimes, in C, you can sometimes get to the point where you use conventions that means maybe static or dynamic analysis tools might be able to flag the misuse of the API, but very often, such tools have extremely poor tradeoffs between precision and accuracy, far worse than exists in Rust with just the vanilla compiler.
- mjburgess 2y ago-Wconversion , no? My point isn't that you exhaust all the features of Rust with a better stdlib and "debugger-oriented programming" -- my point is that you can get 95% of the way there with trivial complexity costs. Rust imposes significant program design costs which can be very detrimental to otherwise trivial performant memory management, to faster iteration of software design, and so on. These aren't free lang. features.