r/rust • • Aug 29 '24

One Of The Rust Linux Kernel Maintainers Steps Down - Cites "Nontechnical Nonsense"

https://www.phoronix.com/news/Rust-Linux-Maintainer-Step-Down
586 Upvotes

374 comments sorted by

View all comments

Show parent comments

32

u/Zde-G Aug 29 '24

They had to adapt that attitude precisely because they started too late.

C++ the language can be fixed, C++ community couldn't be fixed and thus they have to do somthing about it, right?

But what could they do at this point? You couldn't make existing code safe, you still need to do a full rewrite and if full rewrite would happen then why wait for the pie-in-sky if you already have Rust can use that for rewrite?

14

u/matthieum [he/him] Aug 29 '24

C++ the language can be fixed

I can see a spiritual successor to C++ emerging -- be it Circle, Cpp 2.0, Carbon, whatever -- however attempting to fix C++ is just impractical.

There'd be so much to add and so much to throw out that near all C++ code under the Sun would have to be rewritten, which is just completely impractical.

Even for spiritual successors, seamless inter-operability is a very large hurdle given the complexity of their predecessor, and the myriad small details that just get in the way.

3

u/Zde-G Aug 29 '24

I can see a spiritual successor to C++ emerging -- be it Circle, Cpp 2.0, Carbon, whatever -- however attempting to fix C++ is just impractical.

Ada did that, why couldn't C++ do the same?

It's perfectly doable, just pointless.

There'd be so much to add and so much to throw out that near all C++ code under the Sun would have to be rewritten, which is just completely impractical.

Not only this is practical, we can be pretty much sure that it would happen, eventually. But yeah, this would happen one funeral at a time.

Even for spiritual successors, seamless inter-operability is a very large hurdle given the complexity of their predecessor, and the myriad small details that just get in the way.

If seamless inter-operability would have been possible then there would be no need to rewrite anything.

1

u/Arve Aug 30 '24

Ada did that, why couldn't C++ do the same?

While Ada may have "fixed" Pascal, Pascal was a fairly minor language already back in the 90's, and Ada was an even smaller community.

So much of the world depends on C and C++, and I doubt "fixing" it would cause developers to write safer code. You can - sort of - see this with Typescript and Javascript - while TS is arguably the "better" language, you'll find enough developers who have used both, and reverted to JS.

1

u/Zde-G Aug 31 '24

That's entirely different question. And yes, you are correct: if people are not willing to fix their shit then fixing the compiler does no good. I have said the exact same thing.

But language fixing can be done and Ada is constructive proof.

Yes, it's, kinda, two languages now: Ada 2022 would verify the code (and reject it if it's unsafe) while Ada 2012 would accept it (and do who knows what in runtime), but Rust, itself, is like that, too: mrustc doesn't have a borrow checker, after all.

2

u/angelicosphosphoros Aug 30 '24

There is already a spiritual successor: it is called Rust.

2

u/matthieum [he/him] Aug 30 '24

No, not at all.

Rust is fresh systems programming language, which draws more from the ML family -- if you ever wondered where all those let came from, now you know -- than from C++.

Rust has a very different set of values than C++ has: safety first, of course, but that's only the tip of the iceberg! For example, Rust is more performance oriented than C++, which is one of the reasons for the absence of stable ABI as it could cripple future performance improvements.

So, no, Rust is definitely not a spiritual successor of C++.

1

u/throwawayeggpoopman Sep 27 '24

What is broken about C++ or C that implies that a fix is necessary? I am not opposed to Rust by any means, but this sort of thinking that "Rust is empirically better" and everything else is old and bad/broken is kind of silly and I can see how, at least to me, it could make one more reluctant to engage with Rust and be open to it. At the end of the day C/C++/any other language is a tool. If you misuse a tool, you can and will get bad results. But every tool has its tradeoffs.

2

u/matthieum [he/him] Sep 27 '24

What is broken about C++ or C that implies that a fix is necessary?

Well, I wouldn't use the term broken... but Undefined Behavior is really bad. In the (potential) presence of Undefined Behavior, it's by definition impossible to reason about program behavior, since the behavior of the whole program is then undefined.

It's not a matter of age necessarily: Lisp is older than both and free of Undefined Behavior, for an extreme example.

And Rust is not even the first systems programming language to be safe (by default), merely the first to gain that much traction. I believe ATS is safe, for example, though don't take my word for it.

At the end of the day C/C++/any other language is a tool. If you misuse a tool, you can and will get bad results. But every tool has its tradeoffs.

That is somewhat true, but there's a fairly broad range of consequences available.

If you misuse (safe) Rust, or Java, you may end up with a panic/exception OR with an unexpected value. It's not ideal, sure, but it's a fairly bounded behavior.

If you misuse C or C++, you may end up with... anything. Like, a read-only cache passed to the function may have gotten corrupted. Even though it's read-only. The neighbouring thread stack may have gotten corrupted. Even though it's literally a completely distinct thread. Anything.

The difference between bounded and unbounded consequences is really stark.

It's hard to build a reliable system when a single mishap in a side-module can lead to trampling the memory of anything in the process. And it's hard to figure out where the bug comes from, when it may come from outside the callstack and you just happened to be unlucky.

So in the end, the costs/benefits analysis goes against C and C++, which is why large companies like Amazon, Google, or Microsoft -- which are all about economies of scale -- are pushing to switch.

C and C++ may have been worth it in the past, for the performance you could eek out of them. Though even then if reliability was so necessary that the system was split into multiple-processes, performance would suffer. But nowadays with Go or Rust, there's languages that offer similar to better1 performance at a much lower cost.

1 Theoretically, C, C++, and Rust tend to be all in the same performance bucket, so there's very few cases where one could, at the limit, perform better than the other. Hell, all 3 allow going down to inline assembly. The main advantage of Rust, is that the compiler keeps you safe even as you push the enveloppe, so that you can get more performance with less effort, and less risks, which ultimately gives an edge to Rust when costs come into the picture.

3

u/WanderingCID Aug 29 '24

If the language can be fixed, why hasn't it been done already? Don't forget, memory-safe languages got created out of frustration for C and C++.

4

u/Zde-G Aug 29 '24

If the language can be fixed, why hasn't it been done already?

Because fixing the langauge is pointless if community wouldn't accept that.

Even Rust is having trouble kicking out people who ignore the rules. That happened once and that was really big deal, C++ user community is too stuck in their ways for that to ever work.

Don't forget, memory-safe languages got created out of frustration for C and C++.

Wow. What kind of time machines was used to go back in time 20+ years?

Memory safe languages existed for decades before C and C++ were ever invented.

They were sold as a magical solution to the lack of competence issue… and they don't work for that.

Rust offers practical solution… which only works if language and language users are cooperting.

C/C++ developers are not cooperating, which is the main, core, issue.

3

u/fintelia Aug 30 '24

Are you saying that it was a good thing that a bullying and harrasment campaign was used to drive a contributor from the Rust community over a technical disagreement? Since your comment sort of comes across that way

5

u/Zde-G Aug 30 '24

No, I'm saying it was a good thing that non-technical issue was resolved that way.

It's similar to the article we are discussing, honestly. Ted Ts'o have, essentially, promised to sabotage the Rust in Linux project. While technical details of sabotage are important the most important part is the intent. And said intent is, the most mild interpretation is “undistinguishable from explicit and purposeful sabotage” (carefully described here by u/CommandSpaceOption ).

And now we are discussing Wedson Almeida Filho resignation because of that. That happened not because of any specific technical disagreements but because of social dynamics: it's hard to work in an environment where people are actively sabotaging your efforts.

Similarly with Nikolay Kim and Actix: the problem was not any particular violation of technical rules or any particular UB, but general disregard to safety culture.

This part, e.g.:

A quick glance at the dependencies reveals that it relies on actix-service, which underpins all of Actix and has a bespoke and unsound Cell implementation.

There are no comments on their bespoke Cell implementation — not only no comments to justify why it’s needed, but no comments at all. So I dug through the commit log to see why they rolled their own unsafe primitive instead of using Rc<RefCell> which would be doing the exact same thing, except safely. Here’s the commit message justifying the change:

add custom cell

That’s it.

It's like a plumber who starts his work with welding shut all safety valves “to ensure that they wouldn't disrupt the work”, or a car driver which plugs all the unused safety belts detectors “to reduce the noise”.

It's pointless to discuss the technical merits of that work. The attitude is throughly wrong. Safety valves are not there to toy you. Unused seat belt detectors purpose is not to cause you cringe from the loud noise. What such person does is simply wrong.

You can try change that attitude (and people tried that with Nikolay Kim), but ultimately, if person continues to be danger for everyone around the only recourse is to kick him (or her) out (fire if you are employing such person, or via some public campaign if that's not your direct report).

1

u/WanderingCID Aug 29 '24

Good point.

Thx.

1

u/WanderingCID Aug 30 '24

If memory safe languages existed before C and C++ why weren't those used in development?

2

u/Zde-G Aug 30 '24

Who told you they weren't used? They were.

Even if you would redefine memory-safe language as “tracing GC based language”, then you'll find out that hey weren't used specifically on PCs because when you have 8KB of RAM (yes, that's kilobytes, not gigabytes and not megabytes) or even whopping 18KB of RAM then GC-based memory-safe languages don't, really, fit. But Xerox invented Smalltalk and used it for GUI in year 1972 and Lisp machines arrived two years after that.

And even these primitive machines used BASIC, which, for all it's faults, is memory-safe language invented before C even existed.

Yes, there were PEEK and POKE, but Java have JNI, too, that doesn't make it non-memory safe.

Just because you don't know history doesn't mean that memory safe languages were not used.

They weren't used for system programming, specifically, but C# and Java, for all their hype, failed to change that.

The whole thing with Java and C# is amazing because it shows how one may take something tried and rejected, spend billions on hype and then send industry into entirely different direction which would make it waste trillions of dollars on useless rewrite of stuff that is already working.

That's certainly an amazing achievement… but it's not technical achievement, specifically, more of a marketing achievement!

-51

u/maxjmartin Aug 29 '24

Because Rust can’t do some things C++ can. Don’t get me wrong. I really like Rust. But as I have been learning and using templates more I find that C++ is the right choice for many situations.

Also that lack of object oriented design support can make things awkward. Also making C++ a good choice for some things.

That said I’m all about using the right tool for the right job. I don’t care how fast a program is if it is broken. Also I don’t think Rust takes memory safety at run time into proper account. In that sense it reminds me of TypeScript in comparison to JavaScript. All of the benefits of TypeScript are lost during the JavaScript runtime. IIR, Rust compiles down to C++. So in effect Rust adds a framework to write better code with enforced safety. Which improves performance and programmer productivity.

But that last fact alone will ensure C++ never dies.

41

u/geckothegeek42 Aug 29 '24

IIR, Rust compiles down to C++.

No?

[Rust] improves performance and programmer productivity.

But that last fact alone will ensure C++ never dies.

How does that follow?

But as I have been learning and using templates more I find that C++ is the right choice for many situations.

Also that lack of object oriented design support can make things awkward. Also making C++ a good choice for some things.

Ill have to disagree. Trying to do OOP in rust is awkward, so don't do it. I seriously doubt there is any real problem that needs OOP. But as long as people try to use OOP to tackle those problems they will think c++ is the right tool. Long term, I think it won't be. Same with ad hoc duck typed templates. You learn a bit about it and think wow what a tool to solve problems. But it's not necessary and extremely fragile when tackling bigger problems.

→ More replies (26)

16

u/jkoudys Aug 29 '24

I don't agree with a single thing you've said, but I do respect your bravery for saying it in r/rust

8

u/sm_greato Aug 29 '24

People in r/rust love smearing Rust, IMO (compared to hardcore fans of other languages). Psychologically, it probably means that they don't appear cultist, which is a massive stereotype they probably don't want. A less cynical reason is that yes, maybe people know the limits of the language and really do want to grow. Rust is not super popular. They definitely migrated here. Who's to say they're not willing to do so again, at least to a lesser degree, in terms of advocating for new features or different tooling?

But here, /u/maxjmartin just seems to have a really naive opinion on this. Like Rust is based on C+⁠+ because LLVM is written in C+⁠+? Just no. That's not sound reasoning. For someone to say that, there must be a really big gap in understanding.

1

u/maxjmartin Aug 29 '24

So the point I’m making about C++ is that it isn’t going to die when it is used to define the toolset that compiles Rust. While Rust is to my knowledge compiled to LLVM assembly code, it is still being handled by a C++ written handler LLVM. Also C++ libs are required to run Rust at least on my machine. So there is a coupling there. In other words Rust isn’t a C++ killer.

Also as I was pointing out in another comment I’m not that familiar with macro writing. So not a Rust expert either. Or C++ for that matter. But I do believe in using the right tool for the right job.

5

u/ukezi Aug 29 '24

It's more like you need a compiler. That compiler at the moment uses LLVM and that is implemented in C++. It doesn't need to be implemented in C++. Could use Rust, Go or even Python, but nobody is going to start reimplementing LLVM anytime soon.

For the libs you need certain system libs, mainly a C lib like musl libc or glibc, that expose a standardised C interface. You can write them in a lot of languages, most often it's C, but they could be written in Rust.

→ More replies (10)
→ More replies (1)

2

u/maxjmartin Aug 29 '24

I just had to come back up for air after laughing at the truth of your comment.

Rust is pretty phenomenal, and so are others. The best part about Rust though is it looks out for my stupidity as a programmer.

9

u/Daniyal_Biyarslanov Aug 29 '24

"The lack of object oriented design can make things akward" my dude once i've found out about traits and enums i've never looked back

→ More replies (4)
→ More replies (1)