News for hackers. Stuff that matters.
Re:Deciding to rewrite getaddrinfo in rust by wvenable on Tuesday February 23, 2016 @12:45PM (#11160712)
> Software like glibc is battle-tested

This seems a bit counter-intuitive given that serious problems are still being found years or even decades later. Perhaps battle-tested is insufficient.

And while new code is likely to have bugs, assuming it's already based on the original C code it would be less than if it was re-written from scratch based on a spec. New code can take advantage of the battle-tested nature of the original code even if it's in a different language.

Re:Deciding to rewrite getaddrinfo in rust by goldbrick on Tuesday February 23, 2016 @01:30PM (#11161081)
Yes, there's this whole attitude of "black-boxiness" to these types of arguments that I find troubling; that it is simply the nature of the machine to be unpredictable, and that therefore the safest and best code is the code with the most mileage on it, and every time you poke it you compromise the integrity of the system as whole.

(It's a close cousin to the "don't rewrite it" argument we've all heard via Spolsky et. al., even though they've ended up rewriting their shit several times over).

There is a fundamental shift forward in the types of guarantees you can make with the premises of a language like Rust vs. that of C that I have simply never heard one of these demagogues address.

Re:Deciding to rewrite getaddrinfo in rust by mikegerwitz on Tuesday February 23, 2016 @12:58PM (#11160822)
> This seems a bit counter-intuitive given that serious problems are still being found years or even decades later. Perhaps battle-tested is insufficient.

Bugs will always exist. But that statement will apply equally to any software, regardless of language.

> New code can take advantage of the battle-tested nature of the original code even if it's in a different language.

That's why I referenced the Peter Naur paper on Programming as Theory Building---in practice, that may very well not be the case.

Re:Deciding to rewrite getaddrinfo in rust by dikaiosune on Tuesday February 23, 2016 @01:01PM (#11160852)
> Bugs will always exist. But that statement will apply equally to any software, regardless of language.

I'd be curious to see some research suggesting that the prevalence and severity of those bugs is identical regardless of development tool/language/runtime, but I'd be surprised if that's demonstrable.

The question at hand is not "will safer languages eliminate all bugs?" It's "will safer languages reduce the prevalence and severity of important classes of bugs?" I'd wager it's probably yes, but even if you disagree, I don't think that it's reasonable to suggest that because there will always be bugs we should never improve.

Re:Deciding to rewrite getaddrinfo in rust by mikegerwitz on Tuesday February 23, 2016 @02:55PM (#11161776)
> I'd be curious to see some research suggesting that the prevalence and severity of those bugs is identical regardless of development tool/language/runtime, but I'd be surprised if that's demonstrable.

I intended to convey that software written in any language will have bugs, not that all languages will produce the same types of bugs.

Re:Deciding to rewrite getaddrinfo in rust by Manishearth on Tuesday February 23, 2016 @03:44PM (#11162168)
Yes, but all that gets you is that no language is a panacea; bugs always exist. It does not address the question of whether or not there will be a propensity for more bugs (or more severe bugs) when comparing two languages.
Re:Deciding to rewrite getaddrinfo in rust by mikegerwitz on Tuesday February 23, 2016 @09:37PM (#11164145)
> It does not address the question of whether or not there will be a propensity for more bugs (or more severe bugs) when comparing two languages.

My argument is based on the act of rewriting it---regardless of language. Many languages provide excellent guarantees, but that does not protect against bugs in the implementation itself (logic).

Re:Deciding to rewrite getaddrinfo in rust by Manishearth on Tuesday February 23, 2016 @10:34PM (#11164363)
Yes; and the rewrite can take into account the logic used in the old code (especially in the security-critical areas) as well as all the vulnerabilities that have happened before. You're not starting from a complete blank slate; you can pick up the lessons learned.

Despite being "battle tested", all of these C programs continue to have both memory and logic errors. I think a rewrite would have the same rate of new logic issues after the initial code review and testing. "bugs will always exist" -- sure, so if we have something that eliminates a class of bugs, why not use it? The other classes of bugs will be there (and probably in the same force) whether you rewrite or not.

A lot of these bugs get introduced due to cruft in old code as well. So there are a bunch of tradeoffs here.

Re:Deciding to rewrite getaddrinfo in rust by pcwalton on Wednesday February 24, 2016 @12:16AM (#11164705)
> Many languages provide excellent guarantees, but that does not protect against bugs in the implementation itself (logic).

This is the black and white security fallacy. Memory safety problems are, statistically, a huge quantity of security bugs. By eliminating them you drastically reduce the number of bugs.