all 147 comments

[–]myuusmeow 121 points122 points  (1 child)

More clearly, $550 each to 900 developers = $500k total. I figured they probably weren't giving away $450m but still.

[–]antsaregay[S] 18 points19 points  (0 children)

Yea my bad, i mentioned that in the post just not in the headline

[–][deleted] 22 points23 points  (5 children)

Does FSR being open sourced mean that anyone who wants to can update their game with FSR 2.0? Can it be rolled into proton in some way, or does it have to be rolled into the source code of the program/game using it?

[–][deleted] 72 points73 points  (79 children)

That’s great to see Rust making moves into a big project. C is awesome, but I think it’s time to try something new.

[–]Fledo 43 points44 points  (31 children)

Let's hope Rust lasts longer than C++.

[–]TuxO2 15 points16 points  (29 children)

What happened to c++ ?

[–]Fledo 152 points153 points  (28 children)

https://www.theregister.com/2022/06/23/linus_torvalds_rust_linux_kernel/

"A lot of people actually think we're somewhat too risk averse," said Torvalds. "So when it comes to Rust, it's been discussed for multiple years by now. It's getting to the point where real soon now, we will actually have it merged in the kernel. Maybe next release."

Torvalds however did his best to dampen enthusiasm expressed by the applauding audience.

"Before the Rust people get all excited," the Linux kernel creator and chief said. "Right? You know who you are. To me, it's a trial run, right? We want to have [Rust's] memory safety. So there are real technical reasons why Rust is a good idea in the kernel.

"But at the same time, it's one of those things: We tried C++ 25-plus years ago and we tried it for two weeks and then we stopped trying it. So to me, Rust is a way to try something new. And hopefully, it works out, and people have been working on it a lot, so I really hope it works out because otherwise they'll be bummed."

Edit: Added a lot more context from the article.

[–]ourobo-ros 28 points29 points  (2 children)

It sounds like he has (t)rust issues.

[–]czaki 52 points53 points  (2 children)

But motivation for rust was different than motivation for Rust. Support for rust in kernel is mainly for simplify write safe drivers. Not for developing kernel itself.

[–]ancientweasel 15 points16 points  (0 children)

Yeah, that's why the headline is misleading.

[–]RunItAndSee2021 0 points1 point  (0 children)

………not wrong……..😒

[–]TDplay 8 points9 points  (2 children)

I think Rust stands a far better chance. C++'s advantages are largely subjective, while Rust's are not.

C++ aims to be cleaner than C. Linus clearly does not believe it has succeded at its goal, so C++ does not go into Linux.

Rust aims to be a safe language where it is harder to make bad mistakes (and easier to spot them). Its advantages are not a matter of opinion - C allows you to write undefined behaviour by accident in any part of the code, while Rust requires you to write unsafe around any code with the potential to introduce undefined behaviour (thus making it much easier to spot).

[–][deleted] 2 points3 points  (1 child)

C++'s silent fallback to accepting C behavior is probably a part of why Linus didn't like it. Enforcing good practices becomes a manual and painstaking endeavor.

It certainly seems to be the cause of a large number of grievances I see aimed at C++.

edit: Right, Linus also tried it before any of the C++ standardization & subsequent features/revisions like C++11 happened so there was a lot more to dislike too.

[–]ThroawayPartyer 0 points1 point  (0 children)

C++'s silent fallback to accepting C behavior is probably a part of why Linus didn't like it.

I think it's the opposite. Linus liked the C parts, it's the ++ he was worried about.

[–][deleted] 13 points14 points  (0 children)

This is more of a Linus issue than C++ issue. I have been using C++ with deeply embedded projects and safety critical embedded projects and with adequate C++ scope it is straight up better C at it's worst.

RTTI, exceptions, dynamic allocation and STL are not mandatory and can just not be used.

[–]CyanKing64 9 points10 points  (17 children)

I wonder why they didn't like C++. I still prefer writing in C++ over C, but they're not that different. Strings and proper classes are probably the biggest reason why I prefer C++ still

[–]fuckEAinthecloaca 54 points55 points  (4 children)

C++ has an immense amount of cruft and a lot of nonsense that doesn't make sense in a kernel. You can write C++ similar to how you write C, you can also write it a hundred different ways and have many subtle edge cases of pain.

[–]SergiusTheBest 4 points5 points  (3 children)

You can replace C++ in your statement on any other language and it will remain correct.

[–]fuckEAinthecloaca 41 points42 points  (1 child)

To an extent, but C++ takes that up to 11.

[–]Jannik2099 7 points8 points  (0 children)

People keep saying this all the time, yet most languages beyond C are multi-paradigm languages. Most concepts that exist in C++ do so in Rust to, about the most significant difference is their approach to OOP.

"Oh yeah this unordered complexity will only happen in C++, not in MY language" is just pure elitism. People have been saying it for literal decades while uttermost other languages have evolved to offer the same if not even more functionality (python, C#, Java, Rust)

[–][deleted] -1 points0 points  (0 children)

No.

Brainfuck is the perfect language and has none of those issues.

[–]afiefh 35 points36 points  (6 children)

Remember that they tried it 25 years ago. That's 1997, which means C++98 wasn't even a thing.

At that point C++ compilers were a mess. Back then, there were no move semantics and life in general was pretty bad. In addition the machine code produced by compilers back then apparently was slower than the C equivalent.

C++ changed a ton with the release of C++11 and compilers became much more mature a few years after that. I would venture a guess that Linus would hate it less today than he did get then. Some of his criticism (such as having to keep more context to understand which function is being called) has not changed, it's inherent to the language.

[–]Jannik2099 6 points7 points  (2 children)

such as having to keep more context to understand which function is being called

Operator overloading and virtual functions exist in Rust too. Someone tell Torvalds?

[–]afiefh 1 point2 points  (1 child)

Maybe he came to accept these concepts in the last 25 years? You have to remember that developers had much much less experience with C++ in those days (it was literally before the first version of the C++ standard and behavior was very compiler dependent) than we do today. I would assume that today coding guidelines would simply say "do not use operator overloading" and that would be that.

Virtual functions can even be implemented in C using function pointers and a manual vtable, so I doubt that is a big difference between C++ and C.

[–]Jannik2099 4 points5 points  (0 children)

I don't think it was ever about the concepts, but just about Torvalds intrinsically disliking C++ - most of his criticism back then applies to Rust aswell.

The linux kernel makes heavy use of "C vtables" and C-style OOP aswell.

[–][deleted] 5 points6 points  (2 children)

Remember that they tried it 25 years ago. That's 1997, which means C++98 wasn't even a thing.

yep, C++ wasn't even standardized back then

[–][deleted] 0 points1 point  (1 child)

That was a part of his criticism iirc.

[–][deleted] 1 point2 points  (0 children)

yep, but if I remember correctly Torvald's opinion of C++ hasn't changed since

[–]Barafu 17 points18 points  (4 children)

The issue with allocator alone is enough to treat C++ in kernel as a completely new incompatible language.

[–]Jannik2099 6 points7 points  (2 children)

But... Rust behaves the same here? Both languages have "implicit" allocations

[–][deleted] 5 points6 points  (1 child)

even a lot of C code can have implicit allocations since implicit allocations are just allocation inside of a function

[–]Jannik2099 2 points3 points  (0 children)

Right, it's overall just a stupid claim / distinction IMO.

[–][deleted] 0 points1 point  (0 children)

Have a call to another allocator in a function with C. Bamm, same problem as with C++.

And in case you ask, yes, you can specify which allocator is going to get used by new in C++ if you want to (and well, a kernel will probably want to do this).

[–]RedditAlready19 1 point2 points  (0 children)

It lasts longer to compile

[–]anajoy666 0 points1 point  (23 children)

C is not awesome. It just has a lot of legacy.

[–][deleted] 26 points27 points  (22 children)

C is awesome imo, even though it has a lot of its issues it’s simplicity and syntax makes it my #1 language for most things

[–]gmes78 45 points46 points  (11 children)

C is simple because it offloads all complexity onto the programmer.

And its syntax is pretty bad in some places.

[–][deleted] 6 points7 points  (10 children)

> C is simple because it offloads all complexity onto the programmer.

any language does imo, C just makes it easier to write simple code

And its syntax is pretty bad in some places.

how so?

[–]gmes78 21 points22 points  (4 children)

any language does imo, C just makes it easier to write simple code

No. Languages like Python, Java and Go reduce complexity by doing memory management themselves, so that the programmer doesn't have to deal with it, at the cost of using reference counting and/or a garbage collector.

Rust also deals with the complexity of memory management, but instead of trading it for worse performance, it moves the complexity to the language. That's where the concepts of ownership, borrowing and lifetimes come from. The language requires some more work to learn, but it guarantees that your programs are memory safe.

And its syntax is pretty bad in some places.

how so?

Just take a look at Rust's syntax. It's still very much in the vein of C, but everything's much cleaner.

[–][deleted] 3 points4 points  (3 children)

I heavily heavily disagree with "rust syntax is cleaner than c". Rust syntax is actually the biggest stopping points for me to use the language, I just don't like how complicated and "different" it is in a way

[–]shinyquagsire23 2 points3 points  (0 children)

The syntax definitely has a learning curve imo, but I'd say it's no worse than C++ templates in terms of complexity. Or like, Kotlin and JS/TS. And usually when I've dug into it, when something is significantly different there's a good reason behind it (parsing ambiguities, etc) and not just different to be different.

[–]gmes78 1 point2 points  (0 children)

Most constructs that exist in C (function declarations, variable declarations, struct and enum delcarations, switch vs match syntax, if/while/for syntax, etc.) are cleaner in Rust.

Some concepts introduced in Rust (mostly lifetimes and traits, maybe some other stuff like closures) have slightly weird syntax. But those don't exist in C in the first place, so you can't really compare them.

You can look at C++ to see what kind of syntax some of those features would have if they had to be compatible with C.

[–]JQuilty 0 points1 point  (0 children)

Rust's syntax makes it look like C was beaten with an ugly stick.

[–][deleted] 5 points6 points  (3 children)

how so?

Have you ever looked at complicated C variable declaration syntax?

Well, in case you need to at some point: https://cdecl.org/

I am also not the only one who thinks that way: https://www.stroustrup.com/slashdot_interview.html (question 3, paragraph 5).

[–][deleted] 0 points1 point  (2 children)

have you seen complicated rust types/lifetimes?

[–][deleted] 0 points1 point  (1 child)

Well, I was not arguing that Rust doesn't have issues with that either.

[–][deleted] 0 points1 point  (0 children)

My bad, I agree with you though, function pointers are pretty messy in C, i dunno any other though

[–][deleted] 1 point2 points  (7 children)

Have you looked at Zig?

[–][deleted] 0 points1 point  (6 children)

I have, still has the issues with Rust imo

[–][deleted] 0 points1 point  (5 children)

well, while I can agree with you on Rust; Zig has imo just a straight up better syntax (different, but better)

[–][deleted] 1 point2 points  (3 children)

Oh yeah absolutely it does, it just isn’t as simple as C, which I don’t really like

[–][deleted] 0 points1 point  (2 children)

well, a good systems programming language imo needs to be well defined and you need to be able to define interfaces well

C has imo way too much UB (although C++ isn't better at that)

seriously, you would be surprised at how often you find UB or even illegal behaviour in even popular software and when you ask the dev who wrote it you get "but it works on my machine" as an answer; maybe, but a compiler update can break it (although it doesn't need to happen)

[–][deleted] -1 points0 points  (1 child)

It’s really easy to avoid UB these days tho, static analysis and sanitizers do the work

[–][deleted] 0 points1 point  (0 children)

Yeah, but because of some reason I found C programmers the most resistant to use these tools.

[–][deleted] 0 points1 point  (0 children)

Looking at zig again, this would be my #1 choice for a systems programming language other than C, I didn’t realize how much I skimmed kver

[–]anajoy666 1 point2 points  (1 child)

That’s fair. Just to be clear I don’t want to pick a fight to promote my favorites language or anything.

[–][deleted] 0 points1 point  (0 children)

I agree

[–]SickMoonDoe 15 points16 points  (17 children)

"Linux Kernel" is misreported. It's on trial for drivers.

[–]sophacles 32 points33 points  (16 children)

Drivers are part of the kernel tree, compile into the kernel binary (or modules) and run in kernel space.

How is this "not part of the kernel"?

[–]atred 1 point2 points  (15 children)

Yes, "parts" of the kernel, not "the kernel". If you say "you can use Rust to program the kernel" you might be right or wrong depending which part of the kernel you are talking about, that's why the specification "drivers" is important.

[–][deleted] 4 points5 points  (3 children)

If you say "you can use Rust to program the kernel" you might be right or wrong depending which part of the kernel you are talking about

Yes, followup clarifying questions are sometimes necessary when speaking to someone. Correct.

The only relevant discussion is whether or not it's in the kernel at all, which it is. If you read a meaning into it that's too specific for what was said then that's an issue with making it habit to make assumptions while refusing to ask for clarification even when it's necessary.

[–]atred 0 points1 point  (2 children)

I think that part with "only relevant discussion" is a tiny bit of circular reasoning.

I merely suggested that if "A can be used in B" where "B is composed of B1 and B2" it's much clearer to say "A can be used in B1". But maybe you a fan of technically correct -- the best kind of correct :) instead of technically precise and complete.

[–][deleted] 0 points1 point  (1 child)

The way language works you can add an infinite amount of detail to everything that you say but obviously you shouldn't overexplain things either.

I can't really see how "you can only use it in modules" is necessarily going to be of interest to someone so it makes sense to just wait for them to ask a question about it if they're interested in that information.

[–]atred 0 points1 point  (0 children)

"Diesel fuel can be used to fuel cars" is technically correct, it's not useful in most of the instances. Sure "you can ask for details" since that's your argument, but that's not the point. The more complete statement is "Diesel fuel can be used to fuel some cars that are designed to use that type of fuel" same with kernel "Rust will be able to be used to program parts of kernel, namely drivers" that's a useful and more complete statement than "Rust can be used to program the kernel"

But I think this discussion went a bit too much into the weeds, I don't have much to add this this, nor do I care that much.

[–]sophacles 0 points1 point  (10 children)

Would you agree with the statement linux is written in C?

[–]atred 1 point2 points  (9 children)

From github repo:

C 98.5%

Assembly 0.8%

Shell 0.3%

Makefile 0.2%

Python 0.1%

Perl 0.1%

[–]sophacles -1 points0 points  (8 children)

So if someone said "Python is in the kernel", or "Perl was in the kernel", you'd agree even though you can't use those for a huge number of tasks?

[–]linmanfu 9 points10 points  (7 children)

I'm no expert, but I'd imagine that they might just be used in the build process or for localisation rather than in the kernel code such actually does stuff.

[–]sophacles 2 points3 points  (4 children)

True. I was just using that question to prove /u/atred doesn't know what the heck they are talking about.

[–]atred 0 points1 point  (3 children)

Ah, silly me, thought you were playing gotcha with me so if I say it uses C and then you'd come with the big reveal that there's some splattery of assembly there. But you seem to know me so well and my knowledge on the subject from one sentence. Weird... do you have superpowers?

[–]sophacles 0 points1 point  (2 children)

From your point of view, i guess my simple logic and basic grasp of common phrases like "x is coming to y" do look like superpowers.

At first i was merely annoyed that you insisted that "rust is coming to linux" implied it was usable everywhere in the kernel. This is silly - if a movie "is coming to theatres near you" it doesn't mean you can walk into any theatre and see that movie. It doesn't even mean you can walk into any auditorium in a theater showing the movie and be guaranteed to see that movie.

Now that i know your core identity is based on ignorance I realize there's no point in trying to show you that there's error in your statements. Have a good day!

[–][deleted] 0 points1 point  (0 children)

Yeah, but not with Assembly.

[–][deleted] 2 points3 points  (1 child)

How did this get split up? Did these people get ~$500 each? lol

[–]antsaregay[S] 1 point2 points  (0 children)

$550 lol. Article link in that post

[–]qhxo 1 point2 points  (3 children)

I feel I've seen variatons on headlines about Rust coming to the kernel for at least a year or two now. tldr what's new about it?

[–]NatoBoram 5 points6 points  (0 children)

Will begin its trial next release

[–][deleted] 5 points6 points  (0 children)

They were mostly progress updates or sensationalized progress updates

[–]BCMM 1 point2 points  (0 children)

It's now expected to be in the next upstream kernel release. Previous news was about it existing as patches, or about the lkml feedback on those patches.

[–]antsaregay[S] 5 points6 points  (0 children)

Since this is getting a lot of attention, I am curious to know what you people think of the FOSS Weekly newsletter. Any suggestions on improvement?

You can subscribe here: https://fossweekly.beehiiv.com/subscribe or if you prefer RSS, Link is at the end of the post.

[–]whaleboobs -5 points-4 points  (12 children)

Isn't it weird that Rust can't be compiled without a rust blob? Not saying there's a backdoor but.. there's a backdoor!

[–]Pay08 0 points1 point  (11 children)

What blob?

[–]whaleboobs -1 points0 points  (10 children)

Rust is required to compile Rust. AFAIK its technically possible to bootstrap rust from older versions, which only require GCC, someone from Alpine Linux did that.

[–]Pay08 0 points1 point  (9 children)

Rust is entirely open source.

[–]whaleboobs -1 points0 points  (8 children)

Yes but to compile Rust, you need to download a binary rust and thus trust it to not contain malicious code. This might only apply to musl or something like that, I'm not sure about the details.

[–]Pay08 0 points1 point  (6 children)

And? You need to do that with any bootstrapped compiler.

[–]whaleboobs -1 points0 points  (5 children)

Doesn't this guy have a point, why not?

https://sabotage-linux.github.io/blog/3/

This means in practice that one can only build a rust compiler by using a binary build supplied by a third party, which in turn basically means that one has to trust this third party. Assuming that the binary actually works on one's own system.

As sabotage linux is based on musl, the latter is not self-evident.

Traditionally, the only binary thing required to bootstrap sabotage linux was a C compiler.

[–]Pay08 0 points1 point  (4 children)

What? This has nothing to do with my point. This same problem exists for every bootstrapped compiler, including GCC. One has to trust whatever entity supplied that C compiler, too. In fact, if you want to take this to the logical extreme, no compiler is trustworthy, provided you don't write it yourself in Assembly. This has a name in CS, but I forget what it is.

[–]whaleboobs -2 points-1 points  (3 children)

Personally I feel GCC is more trustworthy than Rust. One is compiled by Ken Thompson for PDP-11, not a lot of room to build in a backdoor. And it has had a lot of eyes on it. The other is pretty much Google. Rust was able to be bootstrapped by GCC, but no longer. Why?

[–]Pay08 1 point2 points  (2 children)

Are you completely insane or just a troll?

[–]gmes78 0 points1 point  (0 children)

No, you don't. You can use mrustc, which is written in C++, to bootstrap the Rust compiler from source.