3 ms·
> Any external tooling can be merged with the compiler or VM. Not so simple. There is a debate whether it's better to specify correctness in the language or ex
by pron 10y ago
> Any external tooling can be merged with the compiler or VM.
Not so simple. There is a debate whether it's better to specify correctness in the language or externally.
> Where does taking a libc implementation and converting with light refactoring fall, given there exists no other implementation in rust?
Probably not worth it. But how about writing a Rust standard library in Rust that doesn't implement libc's API?
> What about a new implementation of SSL that conforms to OpenSSL's API?
May be worth it, given OpenSSL's state and importance.
> What about a new implementation of SSL functions that has a completely new API to achieve the same operations?
Go for it!
- kbenson 10y ago> Not so simple. There is a debate whether it's better to specify correctness in the language or externally. What's a benefit of having an external tool for that compared to something built in? Nothing comes to my mind that wouldn't be better handled as a per-location way to turn specific rules on and off (similar to Rust's unsafe blocks). > Probably not worth it. But how about writing a Rust standard library in Rust that doesn't implement libc's API? Well, yeah, that would be a good thing, but it's largely irrelevant to my point. In this case libc is just a wildly popular library we are considering presenting a new version of (whether it be largely a "fork" and refactor into rust of an existing one or a new implementation). > May be worth it, given OpenSSL's state and importance. Then I don't really think we are in disagreement on the "rewrite everything in rust" stance, as much as how we interpret that statement is different. I take it as far less literal, and more of a shorthand for "let's get rust implementations of critical infrastructure built so we can have some assurance a certain class of bugs can be close to eliminated. If the initial version of that is in some cases a conversion, that's not optimal, but it does provide some benefit, increase the corpus of rust work to refer to, prove rust's capability in the problem space, and provide a springboard for future projects". That's a far cry from "let's rewrite every line of billions of lines of C code into rust because we want to rewrite it all".
- pron 10y ago> What's a benefit of having an external tool for that compared to something built in? Because 1/ building full specification power into the language may make it unnecessarily complex, and 2/ software verification and PL design often progress at different paces, so it's better to have them orthogonal. I It is unclear how such a language should work, and certainly whether anyone has come up with a decent idea yet. For example, the general dependent type approach used by Coq and Agda (and Idris and ATS) doesn't seem to work well so far for software development. So, perhaps theoretically the two may one day be combined, but we don't know how to do it just yet. You can call it an open research question.
- kbenson 10y ago> 1/ building full specification power into the language may make it unnecessarily complex In that case, I'm not sure how you square the school of thought that you can use these external tools to solve the problems of C, or that it's at least more cost effective than something new, like Rust. If it's unnecessarily complex, does it matter if it's compiler+external tool or compiler+integrated tool? I think the same argument cuts both ways, except that in C it just means the tool won't be used, so the software will be of lower quality. > 2/ software verification and PL design often progress at different paces, so it's better to have them orthogonal. Having some verification integrated does not preclude further verification techniques from being developed. Types are a verification technique, and they exist in both C and Rust (at different levels). I'm not sure why it's okay for C to have some included verification, but not for languages to evolve further in this vein.
- pron 10y ago> If it's unnecessarily complex, does it matter if it's compiler+external tool or compiler+integrated tool? I think the same argument cuts both ways, except that in C it just means the tool won't be used, so the software will be of lower quality. I'm not arguing in favor of one approach over another. My original point in this thread was solely about legacy codebases that are well-established and are no longer under active development, hence your arguments about enforcements do not apply. Now I'm talking in general. I don't know what you mean by an integrated tool, but there is a difference between making a language able to specify programs (like Idris), which may make it very difficult to use, or using a language that is relatively easy to use, plus a specification language, that's also easy to use. > I'm not sure why it's okay for C to have some included verification, but not for languages to evolve further in this vein. Again, my original point was only about codebases that aren't heavily developed, like libc. A language like Rust should and will have external verification tools, too, because its type system isn't powerful enough to specify correctness, and that's a good thing (because we don't yet know how to build friendly type systems that are capable of that). All I said was that if the codebase is huge, and if it is established and largely correct, and if it is no longer being heavily maintained, and if the language has good verification tools, and if there are no tests that will catch new bugs you will introduce in the translation, then it is more effective and far cheaper to use those tools than to rewrite in another language.