2 ms·
> Rust can be seen as a language that does not enforce memory correctness with a memory correctness tool bundled into the compiler. What you call "memory corre
by pron 10y ago
> Rust can be seen as a language that does not enforce memory correctness with a memory correctness tool bundled into the compiler.
What you call "memory correctness" is extremely valuable, but isn't correctness (in the software verification sense). Correctness is an external property of an algorithm. There are very few languages that can even express correctness properties. Correctness means something like: "every request will retrieve the relevant user data"; not: "the request will not fail due to a dangling pointer reference".
> I don't think we should be discouraging people from trying to make that jump out of C for our infrastructure
But I'm not discouraging people to move out of the C infrastructure. I want people to write new infrastructure. I just think it's a waste of effort to rewrite old infrastructure in new languages. To use your analogy, people want to rebuild the same mud huts just out of better mud. I say to them: what do you want? Do you want better mud huts? Then reinforce what you have; it will be a lot cheaper. But if you want to build something from scratch, why not build something new? Why spend the development budget on what is essentially maintenance? I don't know if that would be worth it, but at least it seems more worthwhile than re-implementing 1960-70s design with 201x materials, when we can make sure those mud huts stand long enough until we do come up with something new.
- kbenson 10y ago> Correctness is an external property of an algorithm. While true (depending on what you think I meant by correct in that context), it's largely irrelevant to my point. Any external tooling can be merged with the compiler or VM. > I just think it's a waste of effort to rewrite old infrastructure in new languages. As you've stated multiple times here. Can I get a few examples of what you mean? I suspect there's a mismatch in our interpretation of the meaning of that statement. Where does taking a libc implementation and converting with light refactoring fall, given there exists no other implementation in rust? What about a new libc implementation from scratch in rust, using rust, given that there exist (non-rust) libc implementations? What about a new libc implementation from scratch in rust, when there exists another rust libc implementation that isn't just a conversion? What about an SSL library conversion (OpenSSL or NSS)? What about a new implementation of SSL that conforms to OpenSSL's API? What about a new implementation of SSL functions that has a completely new API to achieve the same operations?
- 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.