One Of The Rust Linux Kernel Maintainers Steps Down - Cites "Nontechnical Nonsense" (www.phoronix.com)
from pnutzh4x0r@lemmy.ndlug.org to linux@lemmy.ml on 29 Aug 2024 11:23
https://lemmy.ndlug.org/post/1044280

Wedson Almeida Filho is a Microsoft engineer who has been prolific in his contributions to the Rust for the Linux kernel code over the past several years. Wedson has worked on many Rust Linux kernel features and even did a experimental EXT2 file-system driver port to Rust. But he’s had enough and is now stepping away from the Rust for Linux efforts.

From Wedon’s post on the kernel mailing list:

I am retiring from the project. After almost 4 years, I find myself lacking the energy and enthusiasm I once had to respond to some of the nontechnical nonsense, so it’s best to leave it up to those who still have it in them.

I truly believe the future of kernels is with memory-safe languages. I am no visionary but if Linux doesn’t internalize this, I’m afraid some other kernel will do to it what it did to Unix.

Lastly, I’ll leave a small, 3min 30s, sample for context here: youtu.be/WiPp9YEBV0Q?t=1529 – and to reiterate, no one is trying force anyone else to learn Rust nor prevent refactorings of C code."

#linux

threaded - newest

0x0@programming.dev on 29 Aug 2024 11:42 next collapse

The kernel is mostly written in C, by C developers… understandably they’re rather refactor C code to make it better instead of rewritting everything in the current fancy language that’ll save the world this time (especially considering proponents of said language always, at every chance they get, sell it as C is crap, this is better).

Linux is over 30yo and keeps getting better and more stable, that’s the power of open-source.

AI_toothbrush@lemmy.zip on 29 Aug 2024 11:56 next collapse

Most reasonable people say c is good, rust is better

troed@fedia.io on 29 Aug 2024 12:04 next collapse

C is crap for anything where security matters. I'll happily take that debate with anyone who thinks differently.

Duke_Nukem_1990@feddit.org on 29 Aug 2024 12:18 next collapse

What debate? You offered zero arguments and “C bad tho” isn’t one.

troed@fedia.io on 29 Aug 2024 13:12 collapse

Do you believe C isn't crap when it comes to security? Please explain why and I'll happily debate you.

/fw hacker, reverse engineer

Duke_Nukem_1990@feddit.org on 29 Aug 2024 13:17 collapse

That’s not how it works. You said:

C is crap for anything where security matters.

Argue for your point.

troed@fedia.io on 29 Aug 2024 13:26 collapse

Figure 2: https://sci-hub.se/https://link.springer.com/article/10.1007/s11416-021-00379-x

Duke_Nukem_1990@feddit.org on 29 Aug 2024 13:27 next collapse

Link dropping is also not arguing.

troed@fedia.io on 29 Aug 2024 13:39 collapse

Citing scientific research is. Now, please post your gut feeling in response.

Duke_Nukem_1990@feddit.org on 29 Aug 2024 13:50 next collapse

You continue to be antagonistic. I don’t think I want to waste my time here.

the_post_of_tom_joad@sh.itjust.works on 29 Aug 2024 13:51 collapse

My gut feeling is you didn’t hook a programmer but a debate pervert (maybe shouldn’t have dropped the D word lol). Some people hear that word and turn they minds off cuz debates are simply a game for them to win. I’d just let this one swim brother

zaphod@sopuli.xyz on 29 Aug 2024 14:43 collapse

Lots of categories which Rust doesn’t prevent, and in the kernel you’ll end up with a lot of unsafe Rust, so it can’t guarantee memory-safety in all cases.

loudwhisper@infosec.pub on 29 Aug 2024 16:21 collapse

The biggest items on the graph are all out of bounds accesses, use-after-free and overflows. It is undeniable that memory safe languages help reducing vulnerabilities, we know for decades that memory corruption vulnerabilities are both the most common and the most severe in programs written in memory-unsafe languages.

Unsafe rust is also not turning off every safety feature, and it’s much better to have clear highlighted and isolated parts of code that are unsafe, which can be more easily reviewed and tested, compared to everything suffering from those problems.

I don’t think there is debate here, rewriting is a huge effort, but the fact that using C is prone to memory corruption vulnerabilities and memory-safe languages are better from that regard is a fact.

unexposedhazard@discuss.tchncs.de on 29 Aug 2024 12:20 next collapse

Maybe when you build some little application or whatever. When building the most used kernel in the world, there are probably some considerations that very few people can even try to understand.

pooberbee@lemmy.ml on 29 Aug 2024 12:30 next collapse

I think most people would agree with you, but that isn’t really the issue. Rather the question is where the threshold for rewriting in Rust vs maintaining in C lies. Rewriting in any language is costly and error-prone, so at what point do the benefits outweigh that cost and risk? For a legacy, battle-tested codebase (possibly one of the most widely tested codebases out there), the benefit is probably on the lower side.

troed@fedia.io on 29 Aug 2024 13:15 next collapse

Isn't that exactly the strawman the maintainer got tired of?

pooberbee@lemmy.ml on 29 Aug 2024 13:49 collapse

Hmm… I admit I didn’t follow the video and who was speaking very well and didn’t notice hostility that others seem to pick up on. I’ve worked with plenty of people who turn childish when a technical discussion doesn’t go their way, and I’ve had the luxury of mostly ignoring them, I guess.

It sounded like he was asking for deeper specification than others were willing or able to provide. That’s a constant stalemate in software development. He’s right to push for better specs, but if there aren’t any then they have to work with what they’ve got.

My first response here was responding to the direct comparison of languages, which is kind of apples and oranges in this context, and I guess the languages involved aren’t even really the issue.

pivot_root@lemmy.world on 29 Aug 2024 15:57 collapse

Part of the hostility was the other maintainer misunderstanding the presenter, going on a diatribe about how the kernel Rust maintainers are going to force the C code to become unrefactorable and stagnate, and rudely interrupting the presenter with another tangent whenever he (the presenter) tried to clarify anything.

An unpleasant mix of DM railroading and gish galloping, essentially.

I wouldn’t quite call it a strawman, but the guy was clearly not engaging in good faith. He made up hypothetical scenarios that nobody asked about, and then denigrated Rust by attacking the scenarios he came up with.

Edit: I was thinking of the wrong fallacy. It is a strawman, yes.

ericjmorey@programming.dev on 29 Aug 2024 17:04 collapse

He made up hypothetical scenarios that nobody asked about, and then denigrated Rust by attacking the scenarios he came up with.

This seems to be the textbook description of a strawman argument.

pivot_root@lemmy.world on 29 Aug 2024 17:11 collapse

Wait, yeah. I was thinking of ad hominem when i wrote that, sorry. Correct, that is a strawman.

Bookmeat@lemmy.world on 29 Aug 2024 14:22 next collapse

If the timeline is long enough then it’s always worth the refactor.

Liz@midwest.social on 30 Aug 2024 03:14 collapse

Seeing as how 40% of the security issues that have been found over the years wouldn’t exist in a memory-safe language, I would say a re-write is extremely worth it.

fartsparkles@sh.itjust.works on 29 Aug 2024 12:47 next collapse

No idea what you’re being downvoted. Just take a look at all the critical CVSS scored vulnerabilities in the Linux kernel over the past decade. They’re all overwhelmingly due to pitfalls of the C language - they’re rarely architectural issues but instead because some extra fluff wasn’t added to double check the size of an int or a struct etc resulting in memory corruption. Use after frees, out of bounds reads, etc.

These are pretty much wiped out entirely by Rust and caught at compile time (or at runtime with a panic).

The cognitive load of writing safe C, and the volume of extra code it requires, is the problem of C.

You can write safe C, if you know what you’re doing (but as shown by the volume of vulns, even the world’s best C programmers still make slip ups).

Rust forces safe® code without any of the cognitive load of C and without having to go out of your way to learn it and religiously implement it.

0x0@programming.dev on 29 Aug 2024 12:53 next collapse

The cognitive load of writing safe C, and the volume of extra code it requires, is the problem of C.

Oh no, i’m having a meltdown with all the cognitive load…

Build all the fancy tools you want. At the end of the day if you put a monkey at the wheel of a Ferrari you’ll still have problems.

Nice that Rust is memory-safe, use it if you want, but why the insistence on selling Rust via C is crap? Doesn’t earn you any points.

How about rustaceans fork the kernel and once it’s fully Rust-only then try and get it to be used instead of the current one… win-win, eh?

Auli@lemmy.ca on 29 Aug 2024 13:19 next collapse

Yes a monkey. All the vulnerabilities that have happened over the decades are just bad c programmers. So the question is are there any good c programmers?

ulterno@lemmy.kde.social on 31 Aug 2024 02:16 collapse

It’s not just about bad/good C programmers. It’s also about how much of the context, the given C programmer has read to make sure they know enough of what they are doing.

No matter how good one is at Programming, they need to make sure to read and remember what is happening in relevant parts of code, while making their one off contribution.

That’s where the part of “leaving it to the computer” comes in. Hence, the usefulness of code checkers and even better if the compiler itself enforces the stuff. As long as the rules are good enough.

Let’s just hope we are not jumping to another language 20 years down the line.

Anti Commercial-AI license

fartsparkles@sh.itjust.works on 29 Aug 2024 13:29 next collapse

I’m not insisting anything; stating C is not a memory-safe language isn’t a subjective opinion.

Note I’m not even a Rust fan; I still prefer C because it’s what I know. But the kernel isn’t written by a bunch of Lewis Hamiltons; so many patches are from one-time contributors and the kernel continues to get inundated with memory safety bugs that no amount of infrastructure, testing, code review, etc is catching. Linux is written by monkeys with a few Hamiltons doing their best to review everything before merging.

Linus has talked about this repeatedly over the past few years at numerous conferences and there’s a reason he’s integrating Rust drivers and subsystems (and not asking them to fork as you are suggesting) to stop the kernel stagnating and to begin to address the issues like one-off patches that aren’t maintained by their original author and to start squashing the volume of memory corruption bugs that are causing 2/3rds of the kernel’s vulnerabilities.

0x0@programming.dev on 29 Aug 2024 13:36 collapse

the kernel continues to get inundated with memory safety bugs that no amount of infrastructure, testing, code review, etc is catching.

I’d say this is the issue to fix. It’s not easy but if anything curl has proven it can be done efficiently.

troed@fedia.io on 29 Aug 2024 13:49 collapse

Yeah, let's see what Bagder has to say about this:

C is unsafe and always will be

The C programming language is not memory-safe. Among the 150 reported curl CVEs, we have determined that 61 of them are “C mistakes”. Problems that most likely would not have happened had we used a memory-safe language. 40.6% of the vulnerabilities in curl reported so far could have been avoided by using another language.

Rust is virtually the only memory-safe language that is starting to become viable.

https://daniel.haxx.se/blog/2023/12/13/making-it-harder-to-do-wrong/

MotoAsh@lemmy.world on 29 Aug 2024 14:58 collapse

Memory safe language that’s becoming viable … as a proper replacement of C.

There are many other memory safe languages out there. Just not ones most would like to pull in to the kernel…

qqq@lemmy.world on 29 Aug 2024 16:10 collapse

The vast majority wouldn’t be able to be pulled into the kernel since they rely on the existence of the kernel via syscalls.

MonkderVierte@lemmy.ml on 29 Aug 2024 14:02 next collapse

Someone stubbed a toe here.

JackbyDev@programming.dev on 30 Aug 2024 12:57 next collapse

At the end of the day if you put a monkey at the wheel of a Ferrari you’ll still have problems.

My eyes are rolling onto the floor and down the stairs.

ulterno@lemmy.kde.social on 31 Aug 2024 02:27 collapse

I honestly like the cognitive load. Just not when I am at the workplace, having to deal with said load, with the office banter in the background and (not so) occasionally, being interrupted for other stuff.
And my cognitive load is not even about the memory allocations, most of the time.

Off topic:

I think, if one is seriously learning programming from a young age, it is better to start with C, make a project, big enough to feel the difficulty and understand what the cognitive load is all about and get used to it, hence increasing their mental capability. Then learn the memory safe language of their choice.
I never made a big enough project in C, but you can get to feel the load in C++ too.

corsicanguppy@lemmy.ca on 29 Aug 2024 14:46 next collapse

having to go out of your way to learn it and religiously implement it.

Look! I painted the mona lisa in ketchup.

qqq@lemmy.world on 29 Aug 2024 16:24 collapse

They’re being downvoted because it’s a silly comment that is basically unrelated and also extremely unhelpful. Everyone can agree that C has footguns and isn’t memory safe, but writing a kernel isn’t memory safe. A kernel written in Rust will have tons of unsafe, just look at Redox: github.com/search?q=repo%3Aredox-os%2Fkernel unsa… That doesn’t mean it isn’t safer, even in kernel space, but the issues with introducing Rust into the kernel, which is already written in C and a massive project, are more nuanced than “C bad”. The religious “C bad” and “C good” arguments are kinda exactly the issue on display in the OP.

I say this as someone who writes mostly Rust instead of C and is in favor of Rust in the kernel.

witx@lemmy.sdf.org on 30 Aug 2024 06:59 collapse

The difference is that now you have a scope of where the memory unsafe code might be(unsafe keyword) and you look there instead of all the C code.

qqq@lemmy.world on 30 Aug 2024 15:00 collapse

I agree and think that should be helpful, but I hesitate to say how much easier that actually makes writing sound unsafe code. I’d think most experienced C developers also implicitly know when they’re doing unsafe things, with or without an unsafe block in the language – although I think the explicit unsafe should likely help code reviewers and tired developers.

It is possible to write highly unsafe code in Rust while each individual unsafe block appears sound. As a simple example: play.rust-lang.org/?version=stable&mode=debug&edi… [1] Run that on Debug and Release builds. Notice the output is different? Don’t take that example as some sort of difficult case, you wouldn’t write this code, but the concepts in it are a bit worrisome. That code is a silly example, but each individual unsafe block appears sound when trying to reason only within the block. There is unsafe behavior happening outside of the unsafe blocks (the do_some_things function should raise eyebrows), and the function we ultimately end up in has no idea something unsafe has happened.

Unsafe code in Rust is not easy, and to some extent it breaks abstractions (maybe pointers in general break abstractions to some extent?). noaliases in that playground code rightly assumes you can’t have a &ref and &mut ref to the same thing, that’s undefined behavior in Rust. Yet to understand the cause of that bug you have to look at all function calls on the way, just as you would have to in C, and one of the biggest issues in the code exists outside of an unsafe block.

[1]: If you don’t want to click that link or it breaks, here is the code:

fn uhoh() {
    let val = 9;
    let val_ptr: *const usize = &val;
    do_some_things(val_ptr);
    println!("{}", val);
}

fn do_some_things(val: *const usize) {
    let valref = unsafe { val.as_ref().unwrap() };
    let mut_ptr: *mut usize = val as *mut usize;
    do_some_other_things(mut_ptr, valref);
}

fn do_some_other_things(val: *mut usize, normalref: &usize) {
    let mutref = unsafe 
corsicanguppy@lemmy.ca on 29 Aug 2024 14:45 next collapse

C is crap for anything where security matters.

True for people misusing it. If you want to argue the ease of mis-use, it’s a fun talk.

MotoAsh@lemmy.world on 29 Aug 2024 15:56 collapse

Yea, it’s not C that is crap, but that it has zero guard rails. Like blaming a knife for not having a guard… Is it a bad knife without a guard? Depends on how sharp it is. The guard is orthogonal to the knife’s purpose, but might still be important when the knife is used.

Just because something doesn’t help prevent accidents does not mean it cannot serve its actual purpose well, unless its actual purpose is safety.

[deleted] on 29 Aug 2024 16:31 collapse

.

troed@fedia.io on 29 Aug 2024 17:11 next collapse

Agree. I'm an absolutely awesome software dev myself - and I know C by heart (being my favorite language after assembler). However, with age comes humility and the ability to recognize that I will write buggy code every now and then.

Better the language saves me when I can't, in security critical situations.

ulterno@lemmy.kde.social on 31 Aug 2024 01:45 collapse

Even if you manage to keep all memory accesses in your memory, while writing the code, there’s a good chance you’ll forget something when reviewing another person’s MR. That’s probably the main problem creator.

Still, a language that you are familiar with, is better than a new language that you haven’t finished reading the specifications of. And considering that adding new maintainers comes with a major effort of verifying trustworthiness, I get how it would be harder to switch.

cerement@slrpnk.net on 29 Aug 2024 17:48 collapse

such a weird dichotomy in Windows – secure kernel space and privacy-nightmare user space … “we’re the only ones allowed to steal your data”

[deleted] on 29 Aug 2024 19:23 collapse

.

Vincent@feddit.nl on 29 Aug 2024 12:36 next collapse

This sounds exactly like the type of nontechnical nonsense they’re complaining about: attacking a strawman (“they’re trying to prevent people from refactoring C code and making them rewrite everything in the current fancy language”) even after explicitly calling out that that was not going to happen (“and to reiterate, no one is trying force anyone else to learn Rust nor prevent refactorings of C code”).

WarmApplePieShrek@lemmy.dbzer0.com on 30 Aug 2024 12:24 collapse

They said it wasn’t going to happen but their plan will result in it happening, how do you square that?

Vincent@feddit.nl on 31 Aug 2024 10:23 collapse

You tell me how it will result in it happening. Who even has the power to force people to learn Rust?

WarmApplePieShrek@lemmy.dbzer0.com on 31 Aug 2024 18:29 collapse

Linus and GKH, if they merge something that breaks every time C programmers change a kernel API

Vincent@feddit.nl on 01 Sep 2024 08:22 collapse

And where did you find that they will do that?

corsicanguppy@lemmy.ca on 29 Aug 2024 14:43 next collapse

at every chance they get, sell it as C is crap, this is better

For ‘sendmail’ values of $C, this resembles another argument. Also, of course for $C=sysvinit.

witx@lemmy.sdf.org on 29 Aug 2024 17:31 next collapse

Better in what ways? Rust’s strong points are not to just make a program more stable, but more secure from a memory standpoint and I don’t think Linux keeps improving on that

sexual_tomato@lemmy.dbzer0.com on 30 Aug 2024 13:22 next collapse

From other discussions I’ve seen, the guy stepping down was frustrated by having C code rejected that made lifetime guarantees more explicit. No rust involved. The patch was in service of rust bindings, but there was 0 rust code being reviewed by maintainers.

Wooki@lemmy.world on 31 Aug 2024 07:58 collapse

Some next level deaf going on. That’s not what was being discussed.

The defensiveness proves just how out of touch and unqualified to comment some people are.

danielquinn@lemmy.ca on 29 Aug 2024 11:46 next collapse

Oof, that video… I don’t have enough patience to put up with that sort of thing either. I wonder how plausible a complete Rust fork of the kernel would be.

rollmagma@lemmy.world on 29 Aug 2024 12:29 next collapse

It’s always been this way. Except that it was kernel developers arguing with kernel developers over C code. Now it’s relative newcomers arguing with kernel developers over Rust code that the kernel devs don’t necessarily care about. Of course it’s going to be a mess.

A fork is of course possible, but operating systems are huge and very complex, you really don’t want to alienate these folks that have been doing exclusively this for 30 years. It would be hard to keep the OS commercially viable with a smaller group and having to do both the day to day maintenance, plus the rewrite. It’s already difficult as it is currently.

Rust will be a huge success in time, long after the current names have lost their impetus. This is not a “grind for 4 years and it’s done” project.

ramble81@lemm.ee on 29 Aug 2024 13:43 collapse

folks that have been doing this exclusively for 30 years

And yet the number of people I hear “just switch to Linux!” When the other person has been using Windows for 30 years blows my mind.

Inertia is a hell of a drug.

superkret@feddit.org on 29 Aug 2024 14:09 collapse

I wouldn’t tell a Windows developer with 30 years experience to just switch to developing for Linux.
Users are different. Most people who have used Windows for 30 years never touch anything outside of the desktop, taskbar and Explorer.

ILikeBoobies@lemmy.ca on 29 Aug 2024 17:18 next collapse

It’s insane to find a windows user that doesn’t live in the terminal, it’s just not designed for it

Linux has a gui for everything

Hotzilla@sopuli.xyz on 29 Aug 2024 21:12 collapse

I have been using Windows for 30 years and Linux for 25 years (debian since 99’). I really would not bash (pun intended) windows users so much, there is place for both of them.

Vincent@feddit.nl on 29 Aug 2024 12:38 next collapse

That person in the audience was really grinding my gears. Just let the folks you’re talking to answer you; no need to keep going on your diatribe when it’s based on a false assumption and waste the whole room’s time.

moriquende@lemmy.world on 29 Aug 2024 21:32 collapse

let’s not lose focus of what’s important here, and that is a room full of people hearing my voice and paying attention to me for as long as I manage to hold it

featured@lemmygrad.ml on 29 Aug 2024 13:48 next collapse

There is a fully Rust based Unix-like OS out there, it’s called Redox and it’s very cool

ericjmorey@programming.dev on 29 Aug 2024 16:55 collapse

It’s also a microkernel and intentional not POSIX compliant (but it’s close to compliant). I like the project, but it’s very experimental on purpose, so we should set our expectations accordingly. I’d love to see it become a success, but it may not be or it may only be successful in a smaller niche than the current Linux ecosystem.

That said, it seems very open to new contributors. I hope more people can help it along.

floofloof@lemmy.ca on 29 Aug 2024 15:11 next collapse

I wonder how plausible a complete Rust fork of the kernel would be.

It sounds highly impractical, and it would probably introduce more issues than Rust solves, even if there were enough people with enough free time to do it. Any change must be evolutionary if it’s going to be achievable.

drwho@beehaw.org on 29 Aug 2024 17:26 next collapse

That’s pretty well answered here: vger.kernel.org/lkml/#s15-3

morrowind@lemmy.ml on 29 Aug 2024 20:58 collapse

Site is unreachable

cerement@slrpnk.net on 29 Aug 2024 17:42 next collapse

NOT a fork of Linux, but Redox is aiming for a Unix-like OS based on Rust – but even with “source compatibility” with Linux/BSD and drivers being in userspace, my guess would be hardware drivers are still going to be a big speed bump

merthyr1831@lemmy.ml on 30 Aug 2024 10:14 next collapse

All you need nowadays for a decent Unix-like is compatibility with a handful of Linux softwares and a web browser. Hell, if you could get WINE working on your kernel you could maybe support as many Windows apps/games as Linux for free.

The big issue, as I see it, is performant drivers for a wide range of hardware. That doesn’t come easy, but I wonder if that can be addressed in a way I’m too inexperienced to know.

But projects like Redox are a genuine threat to the hegemony of Linux - if memory safety isn’t given the true recognition it deserves, projects like Redox serve to be the same disrupting force as Linux once was for UNIX.

qqq@lemmy.world on 30 Aug 2024 22:01 collapse

Redox also takes some inspiration from Plan9 and doc.redox-os.org/…/ch05-00-schemes-resources.html is interesting. Also reading drewdevault.com/2022/…/In-praise-of-Plan-9.html made me a bit more interested in things trying to be more Plan9-like than Unix-like.

blurg@lemmy.world on 29 Aug 2024 17:51 next collapse

There’s certainly a history of Unix and Unix-like forks; which is rather simple compared to the Linux distro forks (go right to the big pic).

ikidd@lemmy.world on 29 Aug 2024 19:40 next collapse

Just fork and port Ext4 to Rust and let the little shit sit in his leaking kiddy pool out back.

WarmApplePieShrek@lemmy.dbzer0.com on 30 Aug 2024 12:19 next collapse

You should do it. The Linux kernel is a C project. You can’t change a 30-year project on a dime. Make your own project with Rust and hookers.

suction@lemmy.world on 31 Aug 2024 05:21 collapse

Why not React?

faltryka@lemmy.world on 29 Aug 2024 11:51 next collapse

Video url:

https://youtu.be/WiPp9YEBV0Q?t=1529

ik5pvx@lemmy.world on 29 Aug 2024 12:04 next collapse

At the cost of sounding naive and stupid, wouldn’t it be possible to improve compilers to not spew out unsafe executables? Maybe as a compile time option so people have time to correct the source.

0x0@programming.dev on 29 Aug 2024 12:09 next collapse

Compilers follow specs and in some cases you can have undefined behavior. You can and should use compiler flags but should complement that with good programming practices (e.g. TDD) and other tools in your pipeline (such as valgrind).

chrash0@lemmy.world on 29 Aug 2024 12:21 next collapse

the semantics of C make that virtually impossible. the compiler would have to make some semantics of the language invalid, invalidating patterns that are more than likely highly utilized in existing code, thus we have Rust, which built its semantics around those safety concepts from the beginning. there’s just no way for the compiler to know the lifetime of some variables without some semantic indication

it_depends_man@lemmy.world on 29 Aug 2024 12:31 next collapse

At the cost of sounding naive and stupid

It may be a naive question, but it’s a very important naive question. Naive doesn’t mean bad.

The answer is that that is not possible, because the compiler is supposed to translate the very specific language of C into mostly very specific machine instructions. The programmers who wrote the code, did so because they usually expect a very specific behavior. So, that would be broken.

But also, the “unsafety” is in the behavior of the system and built into the language and the compiler.

It’s a bit of a flawed comparison, but you can’t build a house on a foundation of wooden poles, because of the advantages that wood offers, and then complain that they are flammable. You can build it in steel, but you have to replace all of the poles. Just the poles on the left side won’t do.

And you can’t automatically detect the unsafe parts and just patch those either. If we could, we could just fix them directly or we could automatically transpile them. Darpa is trying that at the moment.

MonkderVierte@lemmy.ml on 29 Aug 2024 14:03 next collapse

Meaning a (current) kernel is actually a C to machine code transpiler?

ik5pvx@lemmy.world on 29 Aug 2024 15:18 collapse

Thank you and all the others that took time to educate me on what is for me a “I know some of those words” subject

[deleted] on 29 Aug 2024 13:26 next collapse

.

zaphod@sopuli.xyz on 29 Aug 2024 14:55 next collapse

Modern C compilers have a lot of features you can use to check for example for memory errors. Rusts borrow-checker is much stricter as it’s designed to be part of the language, but for low-level code like the Linux kernel you’ll end up having to use Rust’s unsafe feature on a lot of code to do things from talking to actual hardware to just implementing certain data structures and then Rust is about as good as C.

snaggen@programming.dev on 29 Aug 2024 16:51 next collapse

The problem is that C is a prehistoric language and don’t have any of the complex types for example. So, in a modern language you create a String. That string will have a length, and some well defined properties (like encoding and such). With C you have a char * , which is just a pointer to the memory that contains bytes, and hopefully is null terminated. The null termination is defined, but not enforced. Any encoding is whatever the developer had in mind. So the compiler just don’t have the information to make any decisions. In rust you know exactly how long something lives, if something try to use it after that, the compiler can tell you. With C, all lifetimes lives in the developers head, and the compiler have no way of knowing. So, all these typing and properties of modern languages, are basically the implementation of your suggestion.

WarmApplePieShrek@lemmy.dbzer0.com on 30 Aug 2024 12:24 next collapse

If you write unsafe code then how should it compile?

henfredemars@infosec.pub on 31 Aug 2024 01:40 collapse

I’d like to add that there’s a difference between unsafe and unspecified behavior. Sometimes I’d like the compiler to produce my unsafe code that has specified behavior. In this case, I want the compiler to produce exactly that unsafe behavior that was specified according to the language semantics.

Especially when developing a kernel or in an embedded system, an example would be code that references a pointer from a hardcoded constant address. Perhaps this code then performs pointer arithmetic to access other addresses. It’s clear what the code should literally do, but it’s quite an unsafe thing to do unless you as the developer have some special knowledge that you know the address is accessible and contains data that makes sense to be processed in such a manner. This can be the case when interacting directly with registers representing some physical device or peripheral, but of course, there’s nothing in the language that would suggest doing this is safe. It’s making dangerous assumptions that are not enforced as part of the program. Those assumptions are only true in the program is running on the hardware that makes this a valid thing to do, where that magical address and offsets to that address do represent something I can read in memory.

Of course, pointer arithmetic can be quite dangerous, but I think the point still stands that behavior can be specified and unsafe in a sense.

henfredemars@infosec.pub on 31 Aug 2024 01:44 collapse

This has been done to a limited extent. Some compilers can check for common cases and you can enforce these warnings as errors. However, this is generally not possible as others have described because the language itself has behaviors that are not safe, and too much code relies on those properties that are fundamentally unsafe.

kbal@fedia.io on 29 Aug 2024 12:33 next collapse

3min 30s, sample for context

If you keep watching for 10 minutes, it's an interesting discussion. Too bad they had to cut it short due to time.

Findmysec@infosec.pub on 29 Aug 2024 12:45 next collapse

Who the fuck is this little shit? Can’t they even be a little considerate towards rust? Just because they have 15 years worth of inertia for C doesn’t mean they can close their eyes and say “nope, I’m not interested”. I do not see how the kernel can survive without making rust a first class citizen

IAmNotACat@lemmy.world on 29 Aug 2024 13:08 collapse

It’s Ted Ts’o, the maintainer of the ext4 filesystem amongst other things.

little shit

Though you’re still accurate despite his seniority.

pivot_root@lemmy.world on 29 Aug 2024 16:07 collapse

There’s really only one valid response to Ted Ts’o:

If you think you can do better with C, prove it.

CVE-2024-42304 — crash from undocumented function parameter invariants
CVE-2024-40955 — out of bounds read
CVE-2024-0775 — use-after-free
CVE-2023-2513 — use-after-free
CVE-2023-1252 — use-after-free
CVE-2022-1184 — use-after-free
CVE-2020-14314 — out of bounds read
CVE-2019-19447 — use-after-free
CVE-2018-10879 — use-after-free
CVE-2018-10878 — out of bounds write
CVE-2018-10881 — out of bounds read
CVE-2015-8324 — null pointer dereference
CVE-2014-8086 — race condition
CVE-2011-2493 — call function pointer in uninitialized struct
CVE-2009-0748 — null pointer dereference

luciferofastora@lemmy.zip on 29 Aug 2024 16:50 next collapse

You seem really invested in pointing out those shortcomings. I respect that.

pivot_root@lemmy.world on 29 Aug 2024 17:17 collapse

Arrogant hypocrites are a pet peeve of mine. If someone is going to act like progressive technology changes are beneath them and unnecessary, they should be able to put their money where their mouth is.

cypherpunks@lemmy.ml on 29 Aug 2024 19:42 next collapse

<img alt="Supa Hot Fire gif with large text “put some ice on that burn” overlaid on it" src="https://media1.tenor.com/images/1ded052f6e6302ffd7df51e27d5e295b/tenor.gif">

MigratingtoLemmy@lemmy.world on 30 Aug 2024 02:10 next collapse

Somebody needs to send a public email to the kernel mailing lists with this

WarmApplePieShrek@lemmy.dbzer0.com on 30 Aug 2024 12:20 collapse

How many vulnerabilities have the kernel Rust team introduced in the same time period on the same code?

pivot_root@lemmy.world on 30 Aug 2024 16:02 collapse

Let me know when you find one?

wewbull@feddit.uk on 30 Aug 2024 19:17 collapse

Memory ownership isn’t the only source of vulnerabilities. It’s a big issue, sure, but don’t think rust code is invulnerable.

pivot_root@lemmy.world on 30 Aug 2024 20:38 collapse

Of course. Rust isn’t immune to logic errors, off-by-one mistakes, and other such issues. Nor is it memory safe in unsafe blocks.

Just by virtue of how memory safety issues account for 50%+ of vulnerabilities, it’s worth genuinely considering as long as the bindings don’t cause maintainability issues.

WarmApplePieShrek@lemmy.dbzer0.com on 31 Aug 2024 18:31 collapse

The bindings cause maintainability issues. That’s the problem.

Charadon@lemmy.sdf.org on 29 Aug 2024 13:08 next collapse

omfg, that guy in the video…

jjlinux@lemmy.ml on 29 Aug 2024 13:31 next collapse

Ted Ts’o is a prick with a god complex. I understand his experience is hard to match, we all have something in our lives we’re that good at, but that does not need to lead to acting like a fucking religious fanatic.

IAmNotACat@lemmy.world on 29 Aug 2024 13:39 next collapse

Agreed. His experience might be useful if he were there to engage, but he’s clearly not. It seems like he just wanted to shout down the project and it seems like he was somewhat successful.

pivot_root@lemmy.world on 29 Aug 2024 16:34 next collapse

I understand his experience is hard to match, we all have something in our lives we’re that good at

At some point, that mix of experience and ego becomes a significant liability. He’s directly hurting the adoption of Rust in the kernel, while the C code he’s responsible for is full of problems that would have been impossible if written in safe Rust.

CVE-2024-42304 — crash from undocumented function parameter invariants
CVE-2024-40955 — out of bounds read
CVE-2024-0775 — use-after-free
CVE-2023-2513 — use-after-free
CVE-2023-1252 — use-after-free
CVE-2022-1184 — use-after-free
CVE-2020-14314 — out of bounds read
CVE-2019-19447 — use-after-free
CVE-2018-10879 — use-after-free
CVE-2018-10878 — out of bounds write
CVE-2018-10881 — out of bounds read
CVE-2015-8324 — null pointer dereference
CVE-2014-8086 — race condition
CVE-2011-2493 — call function pointer in uninitialized struct
CVE-2009-0748 — null pointer dereference

riodoro1@lemmy.world on 29 Aug 2024 17:49 next collapse

Dude, three CVEs were enough. Stop kicking the blood puddle.

Flipper@feddit.org on 30 Aug 2024 09:08 collapse

crash from undocumented function parameter invariants

My favourite, as that was the exact point the dev was making in his talk, that the stuff is badly documented and that the function signature would document it perfectly.

WarmApplePieShrek@lemmy.dbzer0.com on 30 Aug 2024 12:18 collapse

My favorite, as that is the exact point made by anti-rust people.

What kind of type signature would prove the first block of any directory in an ext4 filesystem image isn’t a hole?

pivot_root@lemmy.world on 30 Aug 2024 15:54 next collapse

The first directory block is a hole. But type == DIRENT, so no error is reported. After that, we get a directory block without ‘.’ and ‘…’ but with a valid dentry. This may cause some code that relies on dot or dotdot (such as make_indexed_dir()) to crash

The problem isn’t that the block is a hole. It’s that the downstream function expects the directory block to contain . and , and it gets given one without because of incorrect error handling.

You can encode the invariant of “has dot and dot dot” using a refinement type and smart constructor. The refined type would be a directory block with a guarantee it meets that invariant, and an instance of it could only be created through a function that validates the invariant. If the invariant is met, you get the refined type. If it isn’t, you only get an error.

This doesn’t work in C, but in languages with stricter type systems, refinement types are a huge advantage.

WarmApplePieShrek@lemmy.dbzer0.com on 31 Aug 2024 18:32 collapse

Wouldn’t it still crash when the smart constructor was called?

pivot_root@lemmy.world on 31 Aug 2024 19:38 collapse

If it were poorly designed and used exceptions, yes. The correct way to design smart constructors is to not actually use a constructor directly but instead use a static method that forces the caller to handle both cases (or explicitly ignore the failure case). The static method would have a return type that either indicates “success and here’s the refined type” or “error and this is why.”

In Rust terminology, that would be a Result<T, Error>.

For Go, it would be (*RefinedType, error) (where dereferencing the first value without checking it would be at your own peril).

C++ would look similar to Rust, but it doesn’t come as part of the standard library last I checked.

C doesn’t have the language-level features to be able to do this. You can’t make a refined type that’s accessible as a type while also making it impossible to construct arbitrarily.

WarmApplePieShrek@lemmy.dbzer0.com on 01 Sep 2024 16:57 collapse

You can do that in C, too.

pivot_root@lemmy.world on 01 Sep 2024 20:07 collapse

You’re going to need to cite that.

I’m not familiar with C23 or many of the compiler-specific extensions, but in all the previous versions I worked with, there is no type visibility other than “fully exposed” or opaque and dangerous (void*).

You could try wrapping your Foo in

typedef struct {
    Foo validated
} ValidFoo;

But nothing stops someone from being an idiot about it and constructing it by hand:

ValidFoo trustMeBro;
trustMeBro.validated = someFoo;
otherFunction(trustMeBro);

Or even just casting it.

Foo* someFoo;
otherFunction((ValidFoo*) someFoo);
WarmApplePieShrek@lemmy.dbzer0.com on 01 Sep 2024 20:08 collapse

Yes, this is like not checking an error code.

pivot_root@lemmy.world on 01 Sep 2024 20:23 collapse

That’s not the point, though. The point is to use a nominal type that asserts an invariant and make it impossible to create an instance of said type which violates the invariant.

Both validation functions and refinement types put the onus on the caller to ensure they’re not passing invalid data around, but only refinement types can guarantee it. Humans are fallible, and it’s easy to accidentally forget to put a check_if_valid() function somewhere or assume that some function earlier in the call stack did it for you.

With smart constructors and refinement types, the developer literally can’t pass an unvalidated type downstream by accident.

aspensmonster@lemmygrad.ml on 30 Aug 2024 15:56 collapse

What kind of type signature would prove the first block of any directory in an ext4 filesystem image isn’t a hole?

I don’t know if the type system proves it’s not a hole, but the type system certainly seems to force consumers to contend with the possibility by surfacing the outcomes at the type system level. That’s what the Either is doing in the example’s return type, is it not?

fn get_or_create_inode(
    &self,
    ino: Ino
) -> Result<Either<ARef<Inode<T>>, inode::New<T>>>
qqq@lemmy.world on 29 Aug 2024 17:35 next collapse

No intention of validating that behavior, it’s uncalled for and childish, but I think there is another bit of “nontechnical nonsense” on the opposite side of this silly religious war: the RIIR crowd. Longstanding C projects (sometimes even projects written in dynamic languages…?) get people that know very little about the project, or at least have never contributed, asking for it to be rewritten or refactored in Rust, and that’s likely just as tiring as the defensive C people when you want to include Rust in the kernel.

People need to chill out on both sides of this weird religious war. A programming language is just a tool: its merits in a given situation should be discussed logically.

jjlinux@lemmy.ml on 29 Aug 2024 23:01 next collapse

That is the most sensible look into this so far.

JackbyDev@programming.dev on 30 Aug 2024 12:31 collapse

I imagine this mentality is frustrating because of how many times they have to explain that they weren’t forcing people to learn Rust and that the Rust bindings were second class citizens. They never said to rewrite the kernel in Rust.

wewbull@feddit.uk on 30 Aug 2024 19:11 collapse

That’s disengenuous though.

  • We’re not forcing you to learn rust. We’ll just place code in your security critical project in a language you don’t know.

  • Rust is a second class citizen, but we feel rust is the superior language and all code should eventually benefit from it’s memory safety.

  • We’re not suggesting that code needs to be rewritten in rust, but the Linux kernel development must internalise the need for memory safe languages.

No other language community does what the rust community does. Haskellers don’t go to the Emacs project and say “We’d like to write Emacs modules, but we think Haskell is a much nicer and safer functional language than Lisp, so how about we add the capability of using Haskell and Lisp?”. Pythonistas didn’t add Python support to Rails along side Ruby.

Rusties seem to want to convert everyone by Trojan horsing their way into communities. It’s extremely damaging, both to those communities and to rust itself.

CancerMancer@sh.itjust.works on 31 Aug 2024 05:08 collapse

It doesn’t help that the Rust community tends to bring extremely divisive politics with it in places and ways that just don’t need to happen, starting battles that aren’t even tangentially related to programming.

dino@discuss.tchncs.de on 30 Aug 2024 12:16 collapse

Who is Ted Ts’ in this context?

jjlinux@lemmy.ml on 30 Aug 2024 12:55 collapse

He’s the guy you hear vexing rust in the video posted. While both languages have their pros and cons, he chooses to just blast this other guy by repeating the same crap over and over without letting him reply. Basically the kind of person with a “I win because I’m louder” demeanor.

ijhoo@lemmy.ml on 29 Aug 2024 15:13 next collapse

Who was the guy that had a lot of pauses with mmmmmm when talking?

Templa@beehaw.org on 29 Aug 2024 18:21 next collapse

Someone linked the thread from Phoronix forum and the comments are so awful. Imagine having to deal with people like this.

One of them reads:

We need Microsoft people like we need fleas. Why can’t they work for projects we don’t like, like GNOME?

It is funny because Ts’o works at Google, lol.

Vilian@lemmy.ca on 29 Aug 2024 20:15 next collapse

Phoronix comments were always dumb, like, infuriating bad, I don’t even read them anymore, the moderation on that site don’t give a fuck about toxicity in there

ChaoticEntropy@feddit.uk on 30 Aug 2024 10:26 next collapse

I’ve asked one question, one time in those comments and it just got buried in people spitting venom at each other about their file system preferences.

Vivendi@lemmy.zip on 30 Aug 2024 17:29 next collapse

Avis/Bridei/Artem has been active as a super troll on that forum for years and absolutely nothing had been done

vividspecter@lemm.ee on 31 Aug 2024 08:20 collapse

Beyond moderation, Phoronix is a case study in why downvotes are a good thing. Those idiots going on dumb tangents would continue, while the rest of us can read the actual worthwhile comments (which does happen, given AMD employees and the like comment there sometimes).

morrowind@lemmy.ml on 29 Aug 2024 21:07 collapse

Phoronix comments are a special place on the internet. Don’t go there for a good discussion.

possiblylinux127@lemmy.zip on 29 Aug 2024 22:10 collapse

I once started reading the comments on bcachefs. It was a extremely heated for no reason. People were screaming on the nature of btrfs

ramenu@lemmy.ml on 29 Aug 2024 22:40 next collapse

You can’t teach old dogs new tricks.

01189998819991197253@infosec.pub on 30 Aug 2024 01:09 next collapse

You actually can. And it’s not that hard. I had a 14 year old German shepherd mix, who learned several new tricks before her death. I taught a partially blind 79 year old to use a computer, general internet, and email, and was communicating with her [via email] for a number of years before she lost the rest of her vision.

Old dogs, as it were, absolutely can learn new tricks.

Sorry, I just don’t like this idiom, because it puts people in a box in which they do not belong.

ramenu@lemmy.ml on 30 Aug 2024 01:53 next collapse

That’s very wholesome to hear! :) Thank you for sharing. I’m glad it’s not the case.

ulu_mulu@lemm.ee on 30 Aug 2024 07:33 collapse

Many years ago at work, when PCs started to spread, I taught a 60 years old lady how to use one. She never saw a PC before yet she learned pretty well, and I saw much younger people not learning.

Being willing to learn doesn’t depend on age, it’s a mindset, either you have it or you don’t, and if you do have it, it will last your entire life.

WarmApplePieShrek@lemmy.dbzer0.com on 30 Aug 2024 12:21 next collapse

You can, but you can’t turn a 30 year project on a dime. They’re understandably frustrated that newcomers keep coming and screaming RUST RUST RUST RUST RUST

PotatoesFall@discuss.tchncs.de on 30 Aug 2024 21:08 collapse

yeah but this isn’t newcomers making noise. This is seasoned devs making meaningful contributions, and getting reactionary responses

superkret@feddit.org on 30 Aug 2024 15:12 collapse

My grandpa taught himself to text when he was 89. He just wrote a translation table:
A = 2
B = 22
C = 222
D = 3

x00za@lemmy.dbzer0.com on 29 Aug 2024 22:43 next collapse

Even though I respect and applaud the move towards Rust, I absolutely hate the syntax and a lot of the logic.

Maybe the person in the video secretly feels the same way.

ReakDuck@lemmy.ml on 30 Aug 2024 03:10 next collapse

At rhe beginning, I did hate it. Now I slowly embrace it as it seems like a feature to be mkre verbose.

But maybe it will never change and I will just gaslight myself liking it. Whatever… you cant take my fun away learning rust for half a year

x00za@lemmy.dbzer0.com on 30 Aug 2024 11:39 collapse

you cant take my fun away learning rust for half a year

I would never :)

ReakDuck@lemmy.ml on 02 Sep 2024 17:38 collapse

I hate how I can’t do everything I imagine in rust.

But researching about why something isn’t possible, makes me realize that the code should never be wroten like the way I did… so I can’t blame rust for dissallowing me this.

fluxx@lemmy.world on 30 Aug 2024 07:13 next collapse

Well, I’ve been a C/C++ dev for half of my career, I didn’t find Rust syntax ugly. Some things are better than others, but not a major departure from C/C++. ObjC is where ugly is at. And I even think swift is more ugly. In fact, I can’t find too many that are as close to C/C++ as Rust. As for logic… Well, I want to say you’ll get used to it, but for some things, it’s not true. Rust is a struggle. Whether it’s worth it, is your choice. I personally would take it over C++ any day.

x00za@lemmy.dbzer0.com on 30 Aug 2024 11:37 collapse

You should check out C3 if you haven’t yet.

Morphit@feddit.uk on 30 Aug 2024 11:49 collapse

When in doubt - C4!

OrekiWoof@lemmy.ml on 30 Aug 2024 09:31 next collapse

I just don’t understand this. You get used to the syntax and borrow checker in a day or two. It’s a non-issue.

x00za@lemmy.dbzer0.com on 30 Aug 2024 11:34 next collapse

I didn’t. And I also dislike the methodology behind this way of programming.

But that’s personal and doesn’t make me want to trashtalk Rust during somebody’s talk about it.

thevoidzero@lemmy.world on 30 Aug 2024 12:30 next collapse

I wouldn’t say that. For primitives yeah, day or two. But if you want to build a proper program, it’ll take time to get used to it. For my first few projects I just used clone everywhere. Passing by reference and managing lifetimes, specially when writing libraries is something that takes time to get used to. I still don’t feel confident.

Besides that I do like Rust though. Sometimes I feel like “just let me do that, C let’s me”, but I know it’s just adding safety where C wouldn’t care.

aspensmonster@lemmygrad.ml on 30 Aug 2024 15:49 next collapse

You get used to the syntax and borrow checker in a day or two.

As someone who spent a couple months learning rust, this was half true for me. The syntax? Yeah. No problem. The borrow-checker (and Rust’s concept of ownership and lifetimes in general)? Absolutely not. That was entirely new territory for me.

OrekiWoof@lemmy.ml on 31 Aug 2024 00:16 collapse

Could you specify some kind of example where things were hard?

aspensmonster@lemmygrad.ml on 31 Aug 2024 01:44 collapse

I’ll try :) Looks like I still have my code from when I was grinding through The Book, and there’s a couple spots that might be illuminating from a pedagogical standpoint. That being said, I’m sure my thought process, and “what was active code and what was commented out and when,” will probably be hard to follow.

My first confusion was in deref coercion auto dereferencing (edit: see? it’s still probably not 100% in my head :P), and my confusion pretty much matched this StackOverflow entry:

stackoverflow.com/…/what-are-rusts-exact-auto-der…

It took me until Chapter 15 of The Book (on Boxes) to really get a feel for what was happening. My work and comments for Chapter 15:

use crate::List::{Cons, Nil};
use std::ops::Deref;

enum List {
    Cons(i32, Box<List>),
    Nil,
}

struct MyBox<T>(T);

impl<T> Deref for MyBox<T> {
    type Target = T;
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}

impl<T> MyBox<T> {
    fn new(x: T) -> MyBox<T> {
        MyBox(x)
    }
}

#[derive(Debug)]
struct CustomSmartPointer {
    data: String,
}

impl Drop for CustomSmartPointer {
    fn drop(&mut self) {
        println!("Dropping CustomSmartPointer with data `{}`!", self.data);
    }
}

fn main() {
    let b = Box::new(5);
    println!("b = {}", b);

    let _list = Cons(1, Box::new(Cons(2, Box::new(Cons(3,Box::new(Nil))))));

    let x = 5;
    let y = MyBox::new(x);

    assert_eq!(5,x);
    assert_eq!(5, *y);

    let m = MyBox::new(String::from("Rust"));
    hello(&m);
    hello(m.deref());
    hello(m.deref().deref());
    hello(&(*m)[..]);
    hello(&(m.deref())[..]);
    hello(&(*(m.deref()))[..]);
    hello(&(*(m.deref())));
    hello((*(m.deref())).deref());

    // so many equivalent ways. I think I'm understanding what happens
    // at various stages though, and why deref coercion was added to
    // the language. Would cut down on arguing over which of these myriad
    // cases is "idomatic." Instead, let the compiler figure out if there's
    // a path to the desired end state (&str).

    // drop stuff below ...
    let _c = CustomSmartPointer {
        data: String::from("my stuff"),
    };
    let _d = CustomSmartPointer {
OrekiWoof@lemmy.ml on 01 Sep 2024 08:22 collapse

That’s insightful, thank you. It wasn’t hard to follow, I did have these exact same “adventures” but I guess I forgot about them after I figured out the ways to do things.

Personally these kinds of things are exciting for me, trying to understand the constraints etc, so maybe that’s also why I don’t remember struggling with learning Rust, since it wasn’t painful for me 😅 If someone has to learn by being forced to and not out of their own will, it’s probably a lot harder

Metype@lemmy.world on 30 Aug 2024 19:30 next collapse

I tried for about a week: reading documentation, viewing and modifying example programs, using a Rust IDE with warnings for all my silly mistakes, the works. I couldn’t manage to wrap my head around it. It’s so different from what I’m used to. If I could dedicate like a month to learn it I would, but I don’t have the time :/

pivot_root@lemmy.world on 30 Aug 2024 20:59 collapse

Unless you’re a functional programming purist or coming from a systems programming background, it takes a lot longer than a few days to get used to the borrow checker. If you’re coming as someone who most often uses garbage-collected languages, it’s even worse.

The problem isn’t so much understanding what the compiler is bitching about, as it is understanding why the paradigm you used isn’t safe and learning how to structure your code differently. That part takes the longest and only really starts to become easier when you learn to stop fighting the language.

OrekiWoof@lemmy.ml on 31 Aug 2024 00:01 collapse

I see that my previous comment is not the common reality apparently.

I’m mainly a C# + js dev of a few years, and I would love to see what precisely other people here are having problems with, because I’ve had a completely different experience to most of the people replying.

Giooschi@lemmy.world on 30 Aug 2024 10:02 next collapse

That doesn’t really excuse its behavior in the video though.

Wooki@lemmy.world on 31 Aug 2024 03:13 next collapse

You’ve been blue pilled by null. Once over the hurdle, it’s very eloquent.

Null is ugly. Tony Hoare apology for inventing it should be enough reason to learn to do better.

[deleted] on 31 Aug 2024 07:51 collapse

.

slowcakes@programming.dev on 30 Aug 2024 02:44 next collapse

People are dumb as hell, it’s fucking open source, go maintain the c fork, and let the those who want to improve the fucking shit cve producing codebase make a rust fork. And see which one people will use, and we all know that the rust fork will have wider adoption, it’s a no brainer.

No one is forcing them to maintain the Linux kernel, no one is telling them to stop writing patches, they can’t because you can download the code and work on it as you like.

It’s people who know they will be irrelevant because they spent decades producing shit software, and they can’t even be bothered to learn a new language to improve stability and security for the whole fucking userbase. Give me a break, what a bunch of whiners.

0x0@lemmy.dbzer0.com on 30 Aug 2024 03:31 next collapse

Unix -> Linux -> Ferrix?

kwozyman@lemmy.world on 30 Aug 2024 06:33 next collapse

It’s people who know they will be irrelevant because they spent decades producing shit software

So the Linux kernel is shit software now? Just because it’s not written in the newest programming language? Kind of a hot take.

slowcakes@programming.dev on 30 Aug 2024 06:44 collapse

No because it is buggy and have a bunch of security flaws.

witx@lemmy.sdf.org on 30 Aug 2024 06:46 next collapse

This is such a dumb take. For as much as I’d like to have a safer language in the kernel you need the current developers, the “big heads” at least because they have a lot of niche knowledge about their domains and how they implementation works (regardless of language) People shouldn’t take shit like this from the ext4 developer, but it doesn’t mean we should start vilifying all of them.

This guy’s concerns are real and valid but were expressed with the maturity of a lunatic child, but they are not all like this.

slowcakes@programming.dev on 30 Aug 2024 06:59 next collapse

Yes and the big heads in this case don’t want to share that knowledge, because why? Because they are treating the kernel like their pet project that they own and control, and they don’t wanna lose that control, rather looking at the bigger picture.

It’s kinda obvious that rust is the way forward as google has clearly shown, so why are they gatekeeping?

witx@lemmy.sdf.org on 30 Aug 2024 07:03 next collapse

Yes I agree but the solution for a project so big and critical is not to fork. How do you maintain all of it while at the same time adding support to Rust?

slowcakes@programming.dev on 30 Aug 2024 07:12 collapse

There’s no solution, they need not only to accept that rust is going to be part of the kernel but also that it’s a good thing. Otherwise how do you cooperate efficiently.

And also if they are so big brained, should be easy to learn rust then, I mean I’m pretty small brained and I know rust.

WarmApplePieShrek@lemmy.dbzer0.com on 30 Aug 2024 12:23 collapse

“There’s no compromise, I’M RIGHT AND YOU’RE WRONG!”

no wonder everyone hates rustphiles

aaaaace@lemmy.blahaj.zone on 30 Aug 2024 18:40 next collapse

Can we have a vegan rust sub, please?

slowcakes@programming.dev on 31 Aug 2024 11:43 collapse

What compromise? Half code should be in rust?

What does this even have to do with rust developers, The language rust gives us the ability to have more compile time checks, and why is that a bad thing. Do you like security issues in your OS because some dev forgot to handle pointers correctly?

WarmApplePieShrek@lemmy.dbzer0.com on 31 Aug 2024 18:29 collapse

The only compromise Rust programmers would accept is C programmers learn Rust so when they break Rust code they can fix it.

slowcakes@programming.dev on 31 Aug 2024 22:12 collapse

Dude what are you on about, there is no rust programmer that want to teach fucking rust to anyone who doesn’t want learn…

This has nothing to do with C vs Rust, this has to do with security and enabling more people to develop stuff for Linux.

These so called kernel maintainers you see in the conference are only mainting the parts that they use for their filesystem, they are mainting the API, they are paid by companies who have sold support for ext4, xfs or brtfs etc… . Of course they don’t want to make their jobs any harder by learning a new language.

And of course they obfuscate the API with random naming and undocumented usage, because they want to make it hard for anyone else using trying to use the APIs.

If they don’t want to be part of the improvement, then go do something else. Yes rust is better than C for this, because guess what - there are still CVEs being made, because it’s impossible to catch everything with you eyes.

WarmApplePieShrek@lemmy.dbzer0.com on 01 Sep 2024 16:56 collapse

Now that’s a conspiracy theory.

WarmApplePieShrek@lemmy.dbzer0.com on 30 Aug 2024 12:23 collapse

When did they refuse to share knowledge?

slowcakes@programming.dev on 31 Aug 2024 11:47 collapse

That was what he was talking about at the conference, he literally asked for help about how things work, so he could write better APIs that they are more comfortable using.

But the response was we don’t want to write rust.

WarmApplePieShrek@lemmy.dbzer0.com on 31 Aug 2024 18:28 collapse

So what’s the solution that doesn’t involve C programmers writing Rust?

slowcakes@programming.dev on 01 Sep 2024 05:53 collapse

There’s is no other way, C is a security issue - do you understand?

WarmApplePieShrek@lemmy.dbzer0.com on 01 Sep 2024 16:55 collapse

So you want to force C programmers to write Rust or GTFO.

slowcakes@programming.dev on 01 Sep 2024 18:01 collapse

No I want the OS that I use and my server to be less prone to security flaws. If you want to call that write rust or gtfo, so be it. But that is your words not mine, I’m more concerned with security

WarmApplePieShrek@lemmy.dbzer0.com on 01 Sep 2024 20:09 collapse

If you tell most linux developers to gtfo, then whatever is developed by the ones who are left is not mainline linux.

slowcakes@programming.dev on 01 Sep 2024 23:33 collapse

Are you born this way or are you chosing to be this way?

WarmApplePieShrek@lemmy.dbzer0.com on 02 Sep 2024 12:49 collapse

Goodbye

slowcakes@programming.dev on 02 Sep 2024 16:36 collapse

Stop putting words in my mouth then, you are just trying to force me into a corner, where you feel comfortable arguing from. The world isn’t a binary place

merthyr1831@lemmy.ml on 30 Aug 2024 10:06 collapse

If anything, the constant coddling of a few aging individuals within the kernel and the protection of their comforts is why Linux has been so slow to adopt technologies and paradigms that developers are begging for.

Linus complains of dev burnout starving the kernel of contributors, but the processes and technologies driving kernel development are antiquated, and the very suggestion of change is either discarded or makes you the target of a public shaming by Linus himself.

witx@lemmy.sdf.org on 30 Aug 2024 11:52 collapse

I agree with your views. But I have to give praise to Linus for bringing Rust into the kernel.

PotatoesFall@discuss.tchncs.de on 30 Aug 2024 21:06 collapse

Nobody can maintan a fork of the linux kernel on their own or even with a team. It’s a HUGE task.

There already is rust in part of the linux kernel. It’s not a fork.

But I agree with your first statement, people are dumb as hell, me included lol

slowcakes@programming.dev on 31 Aug 2024 11:47 collapse

No shit

antihumanitarian@lemmy.world on 30 Aug 2024 03:17 next collapse

The comments from that article are some of the most vitriolic I’ve ever seen on a technical issue. Goes to prove the maintainer’s point though.

Some are good for a laugh though, like assertions that Rust in the kernel is a Microsoft sabotage op or LLVM is for grifters and thieves.

yournamehere@lemm.ee on 30 Aug 2024 08:01 next collapse

RUST ppl feel like ARCH ppl. yes it might be better than some other setup yadda yadda, but they are so enervating.i’d rather switch back to windows11 than read another post/blog on how som crustians replaced this or that c library. just shut up already.

ZILtoid1991@lemmy.world on 30 Aug 2024 08:26 next collapse

The sad thing is, there are other languages better at replacing C/C++ due to closer resemblance, except they’re rarely used due to lack of trendy technology that is being hyped in Rust. D lost a lot of ground due to its maintainers didn’t make it an “immutable by default” language at the time when functional programming paradigm was the next big thing in programming (which D can still do, as long as you’re not too fussy about using const everywhere).

merthyr1831@lemmy.ml on 30 Aug 2024 10:01 collapse

It was never about replacing C with a new language for the sake of novelty, it was about solving the large majority of security vulnerabilities that are inherent in memory-unsafe languages.

If Rust were to implode tomorrow, some other memory-safe language would come along and become equally annoying to developers who think they’re the first and only person to suggest just checking the code really hard for memory issues before merge.

WarmApplePieShrek@lemmy.dbzer0.com on 30 Aug 2024 12:16 collapse

if you were right they’d replace it with Java.

merthyr1831@lemmy.ml on 01 Sep 2024 16:19 collapse

Rust’s memory safety is at compile-time. Java relies on a virtual machine and garbage collector. Nothing wrong with that approach but there’s a reason Rust is used in kernels and Java is used in userspace apps.

WarmApplePieShrek@lemmy.dbzer0.com on 01 Sep 2024 16:55 collapse

Java was invented 20 years sooner.

wewbull@feddit.uk on 30 Aug 2024 19:20 collapse

Arch people tell you “I use arch BTW”

Rust people make PRs rewriting your code in rust.

Rust people are worse.

merthyr1831@lemmy.ml on 30 Aug 2024 09:57 next collapse

The video attached is a perfect example of the kind of “I’m not prepared to learn anything new so everyone else is wrong” attitude that is eating away at Linux like a cancer.

If memory safety isn’t adopted into the kernel, and C fanaticism discarded, Linux will face the same fate as the kernels it once replaced. Does the Linux foundation want to drag its heels and stuff millions into AI ventures whilst sysadmins quietly shift to new kernels that offer memory safety, or does it want to be part of that future?

WarmApplePieShrek@lemmy.dbzer0.com on 30 Aug 2024 12:15 collapse

If Linux gets rewritten in Rust it will be a new kernel, not Linux. You can make new kernels, even in Rust but they aren’t Linux. You can advertise them at Linux conferences but you can’t force every Linux dev to work on your new Rust kernel.

witx@lemmy.sdf.org on 30 Aug 2024 15:19 next collapse

Isn’t Linux still Linux even though probably a lot of the original code is gone? Why would slowly rewriting it whole, or just parts, in Rust make it stop being Linux?

aspensmonster@lemmygrad.ml on 30 Aug 2024 15:47 next collapse

Isn’t Linux still Linux even though probably a lot of the original code is gone?

The Kernel of Theseus.

witx@lemmy.sdf.org on 30 Aug 2024 16:29 collapse

Indeed :)

repungnant_canary@lemmy.world on 30 Aug 2024 20:44 collapse

Ship of Theseus

cadekat@pawb.social on 30 Aug 2024 17:07 next collapse

Linux is whatever the Linux Mark Institute says it is.

LeFantome@programming.dev on 30 Aug 2024 18:56 next collapse

Nobody is proposing rewriting the whole kernel in Rust.

PotatoesFall@discuss.tchncs.de on 30 Aug 2024 20:26 next collapse

There is no “your” new rust kernel. There is a gigantic ship of Theseus that is the Linux kernel, and many parts of it are being rewritten, refactored, removed an added all the time by god knows how many different people. Some of those things will be done in rust.

Can we stop reacting to this the way conservatives react to gay people? Just let some rust exist. Nobody is forcing everyone to be gay, and nobody is forcing everybody to immediately abandon C and rewrite everything in rust.

caseyweederman@lemmy.ca on 30 Aug 2024 21:25 next collapse

Is a single line of code in the kernel completely unchanged since its birth?

merthyr1831@lemmy.ml on 01 Sep 2024 16:26 collapse

the crew on the Ship of Theseus would like a word with you. Because if you strip out every subsystem and replace them with a different language, everyone would still call it Linux and it would still work as Linux.

Linux isn’t “a bunch of C code” it’s an API, an ABI, and a bunch of drivers bundled into a monorepo.

WarmApplePieShrek@lemmy.dbzer0.com on 01 Sep 2024 16:55 collapse

Linux is a development ecosystem. If everyone agrees to switch to Rust it can switch to Rust with continuity. But they won’t.

gencha@lemm.ee on 30 Aug 2024 11:09 next collapse

I feel like the time to hide information behind YouTube links is over. Feels like a link to a paywall article at this point.

dino@discuss.tchncs.de on 30 Aug 2024 12:14 next collapse

old white man scared of losing their jobs or their commits going insigificant…who cares. Lets move on.

Xer0@lemmy.ml on 30 Aug 2024 14:00 next collapse

Lemmy comment not mentioning the race of someone challenge (IMPOSSIBLE)

cypherpunks@lemmy.ml on 30 Aug 2024 15:04 next collapse

the guy speaking off camera in the linked 3min 30s of the video is Ted Ts’o, according to this report about the session.

ByteOnBikes@slrpnk.net on 30 Aug 2024 21:37 collapse

Losing their jobs? Uh what?

JackbyDev@programming.dev on 30 Aug 2024 16:52 next collapse

This is a little off topic and admittedly an oversimplification, but people saying Rust’s memory safety isn’t a big deal remind me of people saying static typing isn’t a big deal.

LeFantome@programming.dev on 30 Aug 2024 18:55 collapse

Totally

olafurp@lemmy.world on 30 Aug 2024 21:36 next collapse

There’s always going to be pushback on new ideas. He’s basically asking people questions like “Hey how does your thing work? I want to write it in rust.” and gets the answer “I’m not going to learn rust.”.

I think rust is generally a good thing and with a good amount of tests to enforce behavior it’s possible to a functionally equivalent copy of the current code with no memory issues in future maintenance of it. Rewriting things in rust will also force people to clarify the behavior and all possible theoretical paths a software can take.

I’m not gonna lie though, if I would have worked on software for 20 years and people would introduce component that’s written in another language my first reaction would be “this feels like a bad idea and doesn’t seem necessary”.

I really hope that the kernel starts taking rust seriously, it’s a great tool and I think it’s way easier to write correct code in rust than C. C is simple but lacks the guardrails of modern languages which rust has.

The process of moving to rust is happening but it’s going to take a really long time. It’s a timescale current maintainers don’t really need to worry about since they’ll be retired anyway.

IzzyJ@lemmy.world on 30 Aug 2024 23:31 next collapse

I apologize if this is more nontechnical nonsense as Im not a coder, but if the projects are open source, cant he just read and translate the code?

apt_install_coffee@lemmy.ml on 31 Aug 2024 00:34 collapse

For the same reason spoken languages often have semantic structures that make a literal translation often cumbersome and incorrect, translating nontrivial code from one language into another without being a near expert in both langauges, as well as being an expert in the project in question, can lead to differences in behaviour varying from “it crashes and takes down the OS with it”, to “it performs worse”.

MattMatt@lemmy.world on 31 Aug 2024 03:13 collapse

I’ll add that even when you’re an expert in both languages, it’s common to see WTF’s in the original and not be sure if something is a bug or just weird behavior that’s now expected. Especially when going from a looser to a more strict language.

I’ve translated huge projects and most of the risk is in “you know the original would do the wrong thing in these x circumstances – I’m pretty sure that’s not on purpose but… Maybe? Or maybe now someone depends on it being wrong like this?”

olafurp@lemmy.world on 31 Aug 2024 07:22 next collapse

Also, even if you think it’s a bug it might be a feature that other people use and “fixing” changing it might break systems.

GSV_Sleeper_Service@lemmy.world on 31 Aug 2024 21:19 collapse

Even if you wrote the code yourself you can come back to it a while later and have a wtf moment ¯\_(ツ)_/¯

root@precious.net on 02 Sep 2024 06:32 collapse

From a developer standpoint you’re taking someone’s baby, cloning it into a language they don’t understand and deprecating the original. Worse, if you’re not actually interested in taking over the project you’ve now made it abandonware because the original developer lost heart and the person looking for commit counts on GitHub has moved on.

Obviously these extremes don’t always apply, but a lot of open source relies on people taking a personal interest. If you destroy that, you might just destroy the project.

svcg@lemmy.blahaj.zone on 30 Aug 2024 23:54 next collapse

I am no visionary but if Linux doesn’t internalize this, I’m afraid some other kernel will do to it what it did to Unix.

Maybe that’s not a bad thing? If you ask me the GNU people are missing a trick. Perhaps if they rewrote Hurd in Rust they could finally shed that “/Linux”.

uis@lemm.ee on 31 Aug 2024 03:31 next collapse

They will write kernel in Ada

Tlaloc_Temporal@lemmy.ca on 31 Aug 2024 05:28 next collapse

GNU isn’t punchy though; as soon as any punchy word get’s associated with them, people will use that word instead, and we’ll just get GNU/Thermite or GNU/Abson or something.

bonus_crab@lemmy.world on 31 Aug 2024 08:05 collapse

Easy, GNU->GUN

Tlaloc_Temporal@lemmy.ca on 31 Aug 2024 08:18 collapse

Gun! Unix? Not!

Are the version numbers going to be mm or caliber?

bonus_crab@lemmy.world on 01 Sep 2024 20:38 collapse

Gotta be mm to make sense unfortunately, Linux-GUN 7.62.11

myopic_menace@reddthat.com on 02 Sep 2024 02:47 collapse

Maybe a pipe dream, but I would love to see RedoxOS get some traction. A rust based microkernel is a promising concept.

NauticalNoodle@lemmy.ml on 31 Aug 2024 04:31 next collapse

I admit I’m biased towards C-languages out of sheer personal preference and limited exposure to Rust but I am wondering, are there any major technical barriers to Rust replacing these languages in it’s current form anymore?

I know there has been a lot of movement towards supporting Rust in the last 6 years since I’ve become aware of it, but I also get flashbacks from the the early 00’s when I would hear about how Java was destined to replace C++, and the early 2010’s when Python was destined to replace everything only to realize that the hype fundamentally misunderstood the use case limitations of the various languages.

bonus_crab@lemmy.world on 31 Aug 2024 07:58 collapse

Its mainly a matter of stabilizing existing features in the language - there are rust modules in the linux kernel as of 6.1 but they have to be compiled with the nightly compiler.

Rust is a very slow moving , get it right the first time esque, project. Important and relatively fundamental stuff is currently and has been useable and 99% unchanging for years but hasnt been included in the mainline compiler.

Also certain libraries would be fantastic to have integrated into the standard library, like tokio, anyhow, thiserror, crossbeam, rayon, and serde. If that ever happens though itll be in like a decade.

bonus_crab@lemmy.world on 31 Aug 2024 07:58 next collapse

Oh and try blocks.

NauticalNoodle@lemmy.ml on 01 Sep 2024 00:59 collapse

I see. Thanks for the explanation.

slowcakes@programming.dev on 31 Aug 2024 22:18 collapse

What is so hard to understand, C Is a fucking security issues?