Hacker News new | ask | show | jobs
by unshavedyak 545 days ago
Right 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.

2 comments

> 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.

If 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.

I think they were highlighting that that phrase is bullshit. It’s trivial to escape many compile time checks.
Yea, 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.

> 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.

So 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.