this post was submitted on 29 Jan 2025
131 points (100.0% liked)

Linux

5756 readers
495 users here now

A community for everything relating to the linux operating system

Also check out !linux_memes@programming.dev

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS
top 36 comments
sorted by: hot top controversial new old
[–] dinckelman@lemmy.world 8 points 10 hours ago (1 children)

I find this headline incredibly misleading. Proper non-trivial Rust drivers already exist in the kernel. The entire Apple graphical stack for the ARM M-series SoCs is written in Rust, and it’s beyond excellent

[–] ethancedwards8@programming.dev 4 points 6 hours ago (1 children)

I’m not sure it’s mainline yet? It may just be part of the Asahi project. From my understanding, they are being developed out of tree and will be merged/submitted later.

[–] NudeNewt@lemm.ee 2 points 5 hours ago

Yeah a lot of it is in the unstable builds for practically any mainstream distros.

[–] onlinepersona@programming.dev 49 points 1 day ago* (last edited 1 day ago) (7 children)

What is wrong with the commenters on Phoronix? There seem to be a bunch of old dudes who can't accept that C is unsafe and no amount of "skill" will prevent it from being unsafe. They look at 3 decades of unsafe C with thousands of CVEs and still think it's a skill issue.

Anti Commercial-AI license

There are exactly 3 types of phoronix commenters:

  • Trolls
  • People falling for the trolling
  • Professionals working at intel, red hat, etc who use that site as some kind of communications board for some strange, unknown reason
[–] _____@lemm.ee 21 points 1 day ago

I love C and C++ and I talk to someone else who does (comp sci grad) but he's hugely biased against rust and says shit like "rust is cringe it has training wheels, just be good at C"

it's like a weird tech anti-intellectualism

[–] The_Decryptor@aussie.zone 27 points 1 day ago (1 children)

If you think the comments about Rust are bad, you should check out any article about X11/Wayland or systemd.

[–] onlinepersona@programming.dev 16 points 1 day ago (2 children)

Yeah, I don't understand the wayland and systemd hate. Personally, the alternatives are worse in many areas. managing services before systemd was terrible and I'm very happy it's here. Making services depend on magic comments is a terrible system IMO. Can't remember if that's upstart or rinit or whatever.

Anti Commercial-AI license

[–] Feathercrown@lemmy.world 3 points 1 day ago (1 children)

Wayland hate I at least understand. Their security model makes it not a 1:1 replacement for X11 yet, but that's what it's marketed as.

There's definitely stuff it breaks. I still miss Autokey.

[–] fishpen0@lemmy.world -2 points 1 day ago (3 children)

Old NVIDIA gpu here. Wayland is still completely broken for me. I shouldn’t have to buy specific hardware to make my Linux work.

[–] onlinepersona@programming.dev 12 points 1 day ago (1 children)

NVIDIA is a billion (maybe trillion now?) dollar company that leaves it up to people in their free time to support their hardware on linux and you're blaming the unpaid devs, not NVIDIA?

Anti Commercial-AI license

[–] fishpen0@lemmy.world -4 points 8 hours ago* (last edited 8 hours ago)

I’m not blaming anyone. I’m stating a fact that Wayland does not work for me and that as long as that is true, an opinion that x11 is better. I don’t care who fixes it. Especially in the world of running ai models, it’s more and more important that nvidia works in your environment

[–] DarkMetatron@feddit.org 13 points 1 day ago (1 children)

But that is hardly Waylands fault, be angry about Nvidia for having bare to none Linux support for decades.

[–] fishpen0@lemmy.world 1 points 8 hours ago

And yet works fine for me in x11 where my windows and mouse both don’t run at 1fps. I hobby work with ai models and cuda, someone needs to fix it or I’m sticking with x11. I never said it was waylands fault, but given nvidia never acknowledged x11 either and it works over there maybe accepting reality about who is more likely to fix it would be good for that team.

[–] teawrecks@sopuli.xyz 2 points 1 day ago

A Linux user time traveling from the 90s/00s would be elated to know that one day someone could possibly have this opinion.

[–] missphant@lemmy.blahaj.zone 22 points 1 day ago (1 children)

If you open the comments on Phoronix you have already lost.

Learning that the hard way 😂

Anti Commercial-AI license

[–] cm0002@lemmy.world 13 points 1 day ago

The C/C++ fandom is...something else. For many, C is perfect for every use case and everything else higher level from C# to JavaScript is nothing but inefficient waste for programmers who aren't good enough for something like C lol

[–] BassTurd@lemmy.world 7 points 1 day ago (1 children)

Technically, it is a skill issue though, but requires borderline perfection to achieve safe code. It's still a bad argument and detracts from progress in an area where it's sorely needed. Correct me if I'm wrong, but my understanding is that everything unsafe is because the logic used left something exposed where rust has rules in the language the prevents those had coding practices. C is inherently unsafe, it just doesn't have built in safe guards to keep the dev from using it wrong.

Technically, it is a skill issue though, but requires borderline perfection to achieve safe code

If near perfection is the minimum to achieve a goal, then it can't be a skill issue, IMO. But I agree with the rest. It's a terrible argument that keeps getting repeated, not only for C but many other places in the tech world.

Anti Commercial-AI license

[–] SpaceNoodle@lemmy.world 3 points 1 day ago (1 children)

... depending on what you want to do.

Anything useful is still "unsafe."

[–] dgriffith@aussie.zone 24 points 1 day ago (2 children)

Anything useful is still "unsafe."

So you take care with the bits that have to deal with C, just like you have to with C code itself, and then all the rest of your code is still safe by default. Still a net improvement, yes?

[–] deaf_fish@lemm.ee -2 points 1 day ago* (last edited 1 day ago)

Yes, then they shouldn't say it is "safe" because it isn't. They should say "more safe", or be more specific.

[–] bluGill@fedia.io -2 points 1 day ago (1 children)

In a driver what else is there? Either you deal with c or hardware.

[–] thews@lemmy.world 10 points 1 day ago

In a driver, there’s a lot more than just C and hardware interaction. You also have to deal with:

Concurrency and Synchronization – Managing locks, spinlocks, atomic operations, and ensuring safe access to shared resources.

Memory Management – Allocating kernel memory safely, handling DMA buffers, and avoiding memory leaks or invalid accesses.

Interrupt Handling – Dealing with IRQs, deferring work using tasklets, workqueues, or bottom halves.

State Management – Handling suspend, resume, and power states efficiently.

Error Handling and Recovery – Ensuring robustness in the presence of hardware failures or unexpected states.

Device Trees and ACPI – Parsing platform configuration data.

Firmware Communication – Loading and interfacing with device firmware blobs.

Kernel APIs and Subsystems – Interacting with networking, block devices, input devices, and other kernel frameworks.

Performance Optimizations – Managing cache coherency, NUMA awareness, and latency-sensitive operations.

Security Considerations – Preventing privilege escalation, ensuring safe user-space interaction, and sandboxing where applicable.

Yes, interfacing with hardware often requires unsafe Rust or C, but a lot of driver logic isn't directly interacting with raw hardware registers. Rust can help improve safety in many of these areas by reducing common C pitfalls like use-after-free, null dereferences, and buffer overflows.