News for hackers. Stuff that matters.
Re:Unsafe at Any Speed: Tradeoffs and Values in the Rust Eco... by lmm on Thursday January 25, 2024 @07:35PM (#39137470)
> If the author wanted an explanation for a technical decision, they could open an issue and have a conversation like an adult.

Opening an issue comes across as a whole lot more aggressive to me. That implies that they owe you an explanation or you want them to change their code.

> They cry about the existence of some unsafe code, but don’t actually put in the effort to figure out if it can lead to a real problem like unsoundness.

unsafe might as well be unsound. The key benefit of Rust is supposed to be better memory safety than C; if everything is using unsafe, why bother?

> Here’s a post by the maintainer of hyper about what they accomplished in 2023 and what they hope to accomplish in 2024 - https://seanmonstar.com/blog/2023-in-review/

Ok, and that doesn't mention "unsafe" once - no justification for why it's used, much less a plan to reduce or eliminate it.

Re:Unsafe at Any Speed: Tradeoffs and Values in the Rust Eco... by nindalf on Thursday January 25, 2024 @07:44PM (#39137550)
> Opening an issue comes across as a whole lot more aggressive to me. That implies…

It implies nothing. You can politely open an issue and ask why HeaderMap is used instead of HashMap. As long as you’re polite, it’ll be fine.

> unsafe might as well be unsound.

Oh boy, hope you don’t open Vec in the standard library. It can’t be implemented without unsafe and it’s used by almost all Rust programs. I guess every program is unsound, according to you?

> Ok, and that doesn't mention "unsafe" once

Nor does it need to. Just because OP decided this is a problem doesn’t mean it actually is a problem. Find unsoundness and then you have something worth discussing.

Re:Unsafe at Any Speed: Tradeoffs and Values in the Rust Eco... by lmm on Thursday January 25, 2024 @10:35PM (#39138635)
> It implies nothing. You can politely open an issue and ask why HeaderMap is used instead of HashMap. As long as you’re polite, it’ll be fine.

I have direct personal experience that opening an issue to politely ask this kind of design question is not always fine.

> Oh boy, hope you don’t open Vec in the standard library. It can’t be implemented without unsafe and it’s used by almost all Rust programs. I guess every program is unsound, according to you?

Based on past experience with LLVM undefined behaviour, yes, I think it's highly likely that every existing nontrivial Rust program is unsound in current Rust. But "depends on a standard library class that is currently implemented unsafely" will be much easier to fix in the future than "uses unsafe itself".

> Nor does it need to. Just because OP decided this is a problem doesn’t mean it actually is a problem. Find unsoundness and then you have something worth discussing.

Again, why use Rust at all if that's how you feel?

Re:Unsafe at Any Speed: Tradeoffs and Values in the Rust Eco... by nindalf on Friday January 26, 2024 @02:02AM (#39139646)
You have no idea what you’re talking about. You’re so confidently incorrect about Rust that there’s no point even trying to educate you. Good day.
Re:Unsafe at Any Speed: Tradeoffs and Values in the Rust Eco... by dang on Monday January 29, 2024 @01:32AM (#39173389)
Please don't post like this. We have to ban such accounts and I don't want to ban you.

See https://news.ycombinator.com/item?id=39173369 for more.

Re:Unsafe at Any Speed: Tradeoffs and Values in the Rust Eco... by timeon on Friday January 26, 2024 @06:15AM (#39141348)
> The key benefit of Rust is supposed to be better memory safety than C; if everything is using unsafe, why bother?

Is Hyper all contained inside unsafe block? As far as I know it is not. So even if there is some unsafe code it is not same as writing it in C.

Re:Unsafe at Any Speed: Tradeoffs and Values in the Rust Eco... by lmm on Friday January 26, 2024 @08:39PM (#39151460)
Apparently even quite basic things like splitting a string are done in unsafe code. So it sounds like while it may not be 100% unsafe, most of it is.