Huang: Rust: A Critical Retrospective
Huang: Rust: A Critical Retrospective
Posted May 26, 2022 7:42 UTC (Thu) by NYKevin (subscriber, #129325)In reply to: Huang: Rust: A Critical Retrospective by khim
Parent article: Huang: Rust: A Critical Retrospective
The problem is, the LSP is a semantic property. Deciding whether a specific implementation is LSP-compliant depends on the implementation's behavior, the behavior of the superclass, and the API to which both are written. In the general case, it's not only undecidable, but it depends on factors other than the code itself (which parts of the API are contractual?). And then Hyrum's law messes things up further from the other side of the API boundary. So if you want a language that is always provably correct, you can't do anything that depends on the LSP.
But then, all APIs have issues like this to some extent. There will always be fuzzy boundaries around the edges of the contract. If you *really* want provably correct code, you have to do formal verification, and there's a reason that nobody does that in practice.
