3 ms·
This particular example explicitly dodges compile time checking for some ad-hoc (but likely safe) runtime behavior. It’s not a strawman at all. It’s a classic e
by oivey 2y ago
This particular example explicitly dodges compile time checking for some ad-hoc (but likely safe) runtime behavior. It’s not a strawman at all. It’s a classic example of how sometimes the compiler can’t help you, and even worse, how programmers can defeat their ability to help you.
- unshavedyak 2y agoRight but their statement (as i parsed it) was that the the "if it compiles it works" phrase is bullshit. Since there's some cases where it obviously won't be true. At best it's ignorant of what that phrase means, in my view.
- oivey 2y agoI think they were highlighting that that phrase is bullshit. It’s trivial to escape many compile time checks.
- unshavedyak 2y agoYea, but that's my argument - that they're being dense (i imagine on purpose?). The phrase doesn't mean that nothing can fail at runtime. Of course it doesn't. Rather that we have many tools to write a program that can be written with many compile time checks. For example many representations of state can be describe in compile time checks via enums, type transitions, etc.
- brabel 2y ago> The phrase doesn't mean that nothing can fail at runtime. That's exactly what that phrase means, you're twisting the actual words in the phrase to be able to arrive at something more acceptable in your own mind. All you're saying is "oh you shouldn't take it literally". I can guarantee most people take that literally and it's bullshit.
- unshavedyak 2y agoSo you think everyone using that phrase thinks it's not possible to fail at all at runtime, in any manner? Unsafe, Panic and Error would like a word.
- lelanthran 2y ago> Since there's some cases where it obviously won't be true. That's not how I've seen it used every that I have seen it used. > At best it's ignorant of what that phrase means, in my view. I think your opinion on what the phrase means is a minority opinion.
- unshavedyak 2y agoIf it was as wide as the OP said then it means errors, panics, and especially Unsafe wouldn't exist. Even if we ignore unclean sources (say network errors/etc), this isn't a Proofed language where programs in it cannot possibly fail. Besides, it likely is very possible to write programs that cannot fail in Rust. This usually means encoding state into the type system (enums included), but few go through that work. They know what corners they're cutting. Further proving that they know their program can fail. Hell, Rust itself can fail. I struggle to imagine how this is perceived as some long-con from the Rust PR team to convince people Rust programs cannot be written with incorrect logic.