News for hackers. Stuff that matters.
Re:Next steps for Rust in the kernel by dgs_sgd on Wednesday September 21, 2022 @09:28AM (#32924855)
What are the negative stereotypes you associate with Rust and Rust programmers?
Re:Next steps for Rust in the kernel by sidlls on Wednesday September 21, 2022 @09:42AM (#32925035)
The belief that the problem of memory safety that Rust has some compile-time protections against is the only problem (or so much more important problem that the rest almost don’t matter) of programming, and that therefore Rust is the only sane choice to use for any project. There’s a reason that memes like “Rust Evangelism Strike Force” exist.

That’s the biggest one, anyway. I picked up Rust for the first time 8 years ago. I liked it: it felt comfortable in my “worn” C++ hands. But the community outside of a very few core individuals who care deeply about the language’s success can be quite toxic and dismissive of anyone who suggests Rust isn’t basically perfect. And it was a bit of a turn off for me, personally.

Re:Next steps for Rust in the kernel by Klonoar on Wednesday September 21, 2022 @12:09PM (#32927241)
Uh, what? I’ve found Rust as a project and community to be a very self criticizing group - they know when they’ve got it wrong.

They’re simply right about one core thing and they’re loud about it when it comes up. Until something proves them wrong and steals their thunder… I don’t know what to tell you.

Re:Next steps for Rust in the kernel by Jensson on Wednesday September 21, 2022 @02:23PM (#32929138)
In every C++ thread here on HN I've read the past few years there are always some people saying that C++ is unsafe and everyone should migrate to Rust. They might not represent everyone from Rust but that is the part of the Rust community that the C++ community sees the most.

Not sure what to do about that really, but I think it caused many C++ programmers to hate the language before they even tried it.

Re:Next steps for Rust in the kernel by GeekyBear on Wednesday September 21, 2022 @02:52PM (#32929674)
> In every C++ thread here on HN I've read the past few years there are always some people saying that C++ is unsafe

Experience shows that memory safety issues are the most common cause of security issues.

Microsoft:

>As we’ve seen, roughly 70% of the security issues that the [Microsoft Security Response Center] assigns a CVE to are memory safety issues. This means that if that software had been written in Rust, 70% of these security issues would most likely have been eliminated.

https://msrc-blog.microsoft.com/2019/07/22/why-rust-for-safe...

Google:

>Roughly 70% of all serious security bugs in the Chrome codebase are memory management and safety bugs, Google engineers said this week.

https://www.zdnet.com/article/chrome-70-of-all-security-bugs...

Re:Next steps for Rust in the kernel by Jensson on Wednesday September 21, 2022 @03:04PM (#32929882)
You clipped that quote, the aggravating part is where they say that everyone who writes C++ needs to migrate to Rust. Even if it is/was true that will still anger a lot of people when it get posted in every thread about C++.
Re:Next steps for Rust in the kernel by GeekyBear on Wednesday September 21, 2022 @03:19PM (#32930099)
That doesn't excuse downplaying the security issues so common when using languages that do not offer memory safety.

Microsoft:

>we’ll peek at why we think that Rust represents the best alternative to C and C++ currently available.

First, there are plenty of fantastic memory safe languages already available and widely used inside and outside of Microsoft, including .NET languages like C# or F# and other languages like Swift, Go, and Python. We encourage anyone who is currently using C or C++ to consider whether one of these languages would be appropriate to use instead.

We, however, are talking about the need for a safe systems programming language (i.e., a language that can build systems other software runs on, like OS kernels). Such workloads need the speed and predictable performance that C, C++, and Rust provide.

When thinking about why Rust is a good alternative, it’s good to think about what we can’t afford to give up by switching from C or C++ — namely performance and control. Rust, just like C and C++ has a minimal and optional “runtime”. Rust’s standard library depends on libc for platforms that support it just like C and C++, but the standard library is also optional so running on platforms without an operating system is also possible.

Rust, just like C and C++, also gives the programmer fine-grained control on when and how much memory is allocated allowing the programmer to have a very good idea of exactly how the program will perform every time it is run. What this means for performance in terms of raw speed, control, and predictability, is that Rust, C, and C++ can be thought of in similar terms.

https://msrc-blog.microsoft.com/2019/07/22/why-rust-for-safe...

Re:Next steps for Rust in the kernel by menaerus on Thursday September 22, 2022 @08:28AM (#32937919)
> That doesn't excuse downplaying the security issues so common when using languages that do not offer memory safety.

Sure thing but can Rust live up to its memory-safety promise? Or even data-race freedom promise?

I must say that, coming from systems programming background, I was always skeptical about those promises because IMO these problems fundamentally cannot be solved in bare-metal programming language. They're implied by the complexity of HW not loop-holes in programming languages.

That said I see nothing wrong with Rust but I think that people are vastly overselling its core features while at the same time a quick glance over https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=rust will give you exactly a list of bugs which Rust seems to promise not to run into.

Another very recent example, and a very good blog post about memory corruption taking place in Rust: https://www.graplsecurity.com/post/attacking-firecracker

Re:Next steps for Rust in the kernel by sidlls on Thursday September 22, 2022 @09:19AM (#32938400)
That's not a good reason to hate Rust, in my opinion. The community around it, maybe (although "hate" is a strong word), but not the language.
Re:Next steps for Rust in the kernel by Narann on Wednesday September 21, 2022 @10:20AM (#32925524)
Rust community is nice until you use unsafe.

More seriously, the number of peoples you can have a sane discussion about unsafe use is quiet low because when you need to use unsafe is because of a complicate/hard to explain/understand problem.

This combined with the (99% of the time valid) safety dogmas brings some to instantly tell you how to not use unsafe with blatantly bad workaround without considering why you _would_ use unsafe at the first place.

This safety/anti-unsafe dogma makes some peoples far too vocal.

I consider Rust community to be nicer with time, seriously, but I can't say this "I don't understand your problem, but I saw a unsafe, here is a code that doesn't use unsafe" is not a thing. Of course, it's changing, because Rust is more widely use, and "here is when you need unsafe" patterns are emerging. As a Rust user, I'm happy.

Re:Next steps for Rust in the kernel by mustache_kimono on Wednesday September 21, 2022 @11:18AM (#32926352)
> the number of peoples you can have a sane discussion about unsafe use is quiet low

There will always be outliers, but I actually think the Rust community has done a really great job around discussing unsafe in the years since the actix-web issue. See a really great discussion at: https://www.reddit.com/r/rust/comments/we91es/good_example_o...

Just some anec-data, but I had some benchmark code which was unsafe (indexing into an array of bytes, no UTF8 validation), that I wanted to rewrite as safe (by leaning on the std lib, so plenty of unsafe under the hood) just to see how much slower it would be, and the code ended up being ~20-30% faster. Sometimes the unsafe patterns we bring with us just don't match the Rust model.

Re:Next steps for Rust in the kernel by Narann on Wednesday September 21, 2022 @11:53AM (#32926952)
> the Rust community has done a really great job around discussing unsafe in the years since the actix-web issue.

I agree, I started Rust before this drama (I wouldn't call that an _issue_, it was the whole culture that goes wrong here), now peoples try to understand why you need unsafe, but it hasn't been the case and for _years_ it was almost impossible. actix-web is the pivot point but the simple fact you need a sad situation like this show how crazy the safety discussions were before, really.

Once again: Things are changing and I'm more than happy to see pragmatism in the Rust community. But you can't behave like all of this didn't happens.

> Sometimes the unsafe patterns we bring with us just don't match the Rust model.

I agree and noticed this too in some cases (compiler does miracles), that's why discussions have to be serious.

Re:Next steps for Rust in the kernel by burntsushi on Wednesday September 21, 2022 @12:35PM (#32927638)
> now peoples try to understand why you need unsafe

I think that was always the case. actix is a singularly unique example, and I had never seen anything like it before or since. Not even close. There just hasn't been any Rust project with that kind of popularity that also contained egregiously unsound code. So we're not just talking about unnecessary use of unsafe here, but egregiously unsound usage of unsafe.

The attitude toward 'unsafe' has pretty much always been the same. Use it. It exists for a reason. But make sure it's justified and strive for soundness.

Re:Next steps for Rust in the kernel by chomp on Wednesday September 21, 2022 @09:47AM (#32925092)
From my experience, the stereotype is that they are very positive within their own community, very loud and negative towards anything not in the Church of Rust. Of course, this doesn’t fit most Rust programmers, most I’ve met are great people and developers, it’s just the loud people getting the attention.
Re:Next steps for Rust in the kernel by MisterTea on Wednesday September 21, 2022 @10:16AM (#32925467)
The simple fact that they call themselves rustaceans and evangelize the language. It feels the language spread via a religious uprising rather than merit of making good programs easy to write.
Re:Next steps for Rust in the kernel by twic on Wednesday September 21, 2022 @12:34PM (#32927615)
I like Rust the language, and i have found most people in the community to be smart and reasonable. But i also find "Rustaceans" to be rather cringe. I don't think it's specific to Rust; i think this need to form a visible community identity, a brand really, is very common in Silicon Valley culture. Hence why most startups there have cutesy names for employees, people go round sticking logos of software they use on their laptops, etc.

The crab is cool though. As language mascots go, it's a lot more adorable than the Gopher or that LISP alien thing, and almost as adorable as Bjarne Stroustrup.

Re:Next steps for Rust in the kernel by sophacles on Wednesday September 21, 2022 @05:08PM (#32931545)
Ahh yes. Unlike the pythonistas, the gophers, the ziguanas, the lispers, the perl monks, ...
Re:Next steps for Rust in the kernel by gspr on Wednesday September 21, 2022 @10:18AM (#32925506)
Being put off by the evangelizing I can certainly understand – but surely the name "rustaceans" is just some innocent humor.
Re:Next steps for Rust in the kernel by MisterTea on Wednesday September 21, 2022 @10:56AM (#32926069)
In order to be one of the cool kids you have to identify as one. From my point of view the self identifying and adopting a title is key to the indoctrination process.
Re:Next steps for Rust in the kernel by mustache_kimono on Wednesday September 21, 2022 @11:39AM (#32926678)
> In order to be one of the cool kids you have to identify as one.

You really don't? Every time I read a comment like this, I think, "Who hurt you?"

Re:Next steps for Rust in the kernel by gspr on Wednesday September 21, 2022 @10:17AM (#32925491)
I love Rust, it's the most fun I've had programming since first discovering the concept as a kid, with the possible exception of the time I was enamored with Haskell. But one stereotype that I've faced a lot is in connection with the ecosystem. In particular, if you're not satisfied with "rustup everything, then let cargo pull all your deps from crates.io, it just works" as a way of work, you'll sadly face quite a bit of hostility from parts of the community. Seriously; a programming language or its community shouldn't dictate how I assemble and build code! Luckily there are exceptions, and more importantly, the toolchain and ecosystem seem to be getting better in these regards all the time.

Still love the language though, and in general the community is very friendly and welcoming (if not always open to criticism).

Re:Next steps for Rust in the kernel by rust_is_dead on Wednesday September 21, 2022 @09:58AM (#32925244)
I have a word in mind, but before that I would ask: what are some safety-critical systems written in Rust? If there are any, how big a role does Rust play in their safety properties? Is it much different from any other programming language?

I can already hear faint exclamations about the language's age, but are Rust programmers justified in putting forward claims about safety? Or do they shift to using the word in the sense of "fewer bugs in this particular class" (and nevermind any other effects the language may have on development).

Even if we take such a narrow and distorting view of "safety", we can look at, say, "The Power of Ten" and ask how does Rust use fare with each rule, and is it any more advantageous than other languages in use by safety-critical systems.

Re:Next steps for Rust in the kernel by greenhearth on Wednesday September 21, 2022 @11:01AM (#32926135)
I don't think anyone ever said it was completely safe. This is a pre-conception on the part of the critics. Every Rust resource I looked at stated that the toolset exists to support inherent safety, but there is still a contract with the programmer that requires them to know what they are doing.
Re:Next steps for Rust in the kernel by rust_is_dead on Wednesday September 21, 2022 @11:40AM (#32926691)
Rust is "safe" and other languages are "unsafe". Haskell is "pure" while other language are "impure". Some macro systems are "hygienic" while others are "dirty". It is not an accident that the humpty dumpties (language designers) chose to use these particular terms for their semantic distinctions. It's useful for propaganda. The mind encounters a colloquial term and equivocates. This happens in both the critics and the evangelizers. Inferences drawn are then often unjustified.
Re:Next steps for Rust in the kernel by greenhearth on Thursday September 22, 2022 @10:56AM (#32939700)
Agreed, it does appear to be heavily sponsored and marketed. And you are correct that these pre-conceptions affect advocates as well! But I think the push for wide-scale acceptance is not unreasonable. If it is completely necessary I suppose only will be known sometime in the future.
Re:Next steps for Rust in the kernel by allisdust on Wednesday September 21, 2022 @10:29AM (#32925665)
I'm curious what caused you to be so annoyed with the language that you had to create a user name out of it :)