3 ms·
Rust's compiler is the first one I've seen to use the word perhaps. My main gripe is that I still don't fully comprehend lifetimes and the compiler can't reall
by Tade0 3y ago
Rust's compiler is the first one I've seen to use the word perhaps.
My main gripe is that I still don't fully comprehend lifetimes and the compiler can't really help me every time, because it (understandably) errs on the side of caution.
- estebank 3y agoWhenever you see weasel words like that, it means the compiler knows that the issue you encountered could be what it is saying but the necessary metadata to figure out for sure is inaccessible to it. It's the problem with classical stage-oriented compilers. A compiler designed for diagnostics from the beginning would end up looking like a plate of spaghetti where you can call type checking from the parser, to give an example.
- awused 3y ago>It's the problem with classical stage-oriented compilers. A compiler designed for diagnostics from the beginning I'm not sure any compiler, even one "designed for diagnostics," can gather the "necessary metadata" from inside my brain based on my original intentions. If the compiler could unambiguously interpret what I meant to write, it wouldn't have needed to fail with a compilation error in the first place. Whenever I see something like "perhaps" or "maybe" in a compilation error, the information just didn't exist anywhere the compiler could possibly get to, and it's just a suggestion based on common mistakes.