Would using Rust have prevented this?
We found a bug in the hyper HTTP library
61–70 of 97 posts
Re: We found a bug in the hyper HTTP library
#62Earlier quoted context omitted.
I said ‘flagged’, not ‘fixed’ :) You can always write the wrong code if you want it enough. But hopefully a warning would have prompted someone to think harder about this flow.
But "let _ =" is already an explicit suppression of a must-use warning. Where does this arms race of "no, I really know what I am doing, compiler" versus "no, this really looks like a mistake, programmer" end?
Re: We found a bug in the hyper HTTP library
#63This would have been flagged by Clippy lints `let_underscore_untyped` or `let_underscore_must_use`, which sadly are not enabled by default.
Ehh, easy fix #[allow(clippy::let_underscore_untyped,clippy::let_underscore_must_use)] let _ = self.poll_flush(cx)?;
Re: We found a bug in the hyper HTTP library
#64Would using Rust have prevented this?
No. Anyone expecting that hasn't read No Silver Bullet essay.
Brooks was expecting such "Silver Bullet" improvements as often as every few decades, we're arguably overdue significantly. He cites Ada as an example of where such an improvement might come from, well, Rust isn't Ada but a lot of the same ideas about correctness are present.
Google reports order of magnitude changes from their Rust work for example.
Re: We found a bug in the hyper HTTP library
#65Earlier quoted context omitted.
That's not even a bug. That's how TCP works. If you keep sending data to a socket the other side has closed, you get RST.
what is RST?
Re: We found a bug in the hyper HTTP library
#66Earlier quoted context omitted.
No. Anyone expecting that hasn't read No Silver Bullet essay.
Actually I suspect that Rust is a Silver Bullet in that sense. That essay seems to be a case where people know of the essay but haven't read it. Normally in English a "Silver Bullet" is something much bigger, a panacea or cure all which entirely solves a problem but in his essay Brooks is talking about order-of-magnitude improvements, and that looks a lot like Rust. Brooks was expecting such "Silver Bullet" improveme…
Re: We found a bug in the hyper HTTP library
#67Earlier quoted context omitted.
Ehh, easy fix #[allow(clippy::let_underscore_untyped,clippy::let_underscore_must_use)] let _ = self.poll_flush(cx)?;
Yeah, but you must know about them and the possible bug first in order to allow them...
Re: We found a bug in the hyper HTTP library
#68Re: We found a bug in the hyper HTTP library
#69Re: We found a bug in the hyper HTTP library
#70Earlier quoted context omitted.
Or just by not writing let _ =
All recurrent people problems are system problems.
You know what might've solved this though? Using threads instead of async