News for hackers. Stuff that matters.
Re:More Memory Safety for Let's Encrypt: Deploying ntpd-rs by tialaramex on Monday June 24, 2024 @05:13PM (#40780867)
Correctness matters, in their particular game that's especially true although I'm doubtful of common insistence that it's better for this or that software to be fast than correct.

Rust is really good for correctness. Take "Hello, World", the obvious toy program. Someone tried giving it various error states instead of (as would be usual) a normal happy terminal environment. In C or C++ the canonical "Hello, World" program terminates successfully despite any amount of errors, it just doesn't care about correctness.

The default Rust Hello World, the one you get out of the box when you make a new project, or you'd show people on a "My First Rust Program" course, will complain about the errors when they happen. Because doing so is correct.

It's the New Jersey style. The priority for these languages was simplicity of implementation. It's more important that you can cobble together a C compiler easily than that the results are useful or worthwhile. This contributed to C's survival, but we pay the price until we give it up.

Re:More Memory Safety for Let's Encrypt: Deploying ntpd-rs by akaletF on Monday June 24, 2024 @05:19PM (#40780927)
If println panics if the write fails that is kind of cheating, isn't it. Yes, toy C programs do not check the return value of printf. So what.
Re:More Memory Safety for Let's Encrypt: Deploying ntpd-rs by dralley on Monday June 24, 2024 @05:22PM (#40780950)
I would venture to say that most C programs don't check the return value of printf, including ones that ought not to be "toys"
Re:More Memory Safety for Let's Encrypt: Deploying ntpd-rs by akaletF on Monday June 24, 2024 @05:29PM (#40781032)
I don't know. Most serious programs will use write() and then check the return value. In locations where it does not matter (say a test suite that is guaranteed to signal an error but an fprintf() error message could fail in theory) not checking is fine I think.

You will not see the message if you get a panic either ...

Re:More Memory Safety for Let's Encrypt: Deploying ntpd-rs by sans-seraph on Monday June 24, 2024 @10:26PM (#40783708)
> Most serious programs will use write() and then check the return value.

Similarly in Rust, serious programs will use writeln rather than println, and will receive the standard compiler warning if the Result produced by writeln is ignored.

Re:More Memory Safety for Let's Encrypt: Deploying ntpd-rs by toast0 on Monday June 24, 2024 @05:26PM (#40781005)
Setting up your environment so that you have to check for errors or the errors propagate doesn't seem to be cheating when the complaint is that other environments often omit checking for errors even when it matters.