this post was submitted on 17 Jul 2026
166 points (96.1% liked)

Linux

66623 readers
594 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS
(page 2) 48 comments
sorted by: hot top controversial new old
[–] pewpew@feddit.it 4 points 1 week ago (22 children)

What part of Rust is fun?

C is fun to me because the syntax is easy to understand and straight to the point. C is also great for learning low level coding, I find Rust so confusing

[–] HaraldvonBlauzahn@feddit.org 4 points 1 week ago* (last edited 1 week ago) (3 children)

What part of Rust is fun?

C is fun to me because the syntax is easy to understand and straight to the point.

You probably had never the pleasure to search for bugs caused by C Undefined Behaviour in multithreaded code.

When I was writing my diploma thesis, I was writing multi-threaded code for an embedded DSP system. Results were wrong all the time. I tracked it down to atan2() giving wrong results. I searched for about six weeks how to fix that and it disappeared when I changed the position of the program's data segment.

(If the concept of Undefined Behaviour is new to you, I can recommend the web pages of Jens Regehr).

The above debugging experience was 25 years ago. We have better languages now. Rust has no Undefined Behaviour. That means you can track any bug (except compiler bugs) deterministically down to where the actual logic of the code, and the model of it which was in your head depart. This is great.

Rust is fun because you can compile a complex program and it runs.

But industry is still working with a fifty year old language written for systems where 32 kilobytes were a lot of memory. At work, I am still searching for bugs in multi-threaded C code with manual memory management (the previous developer didn't think this needs locks), and I have to explain to the CTO that no, wo won't have a release this fall, while the company literally drowns in technical debt.

[–] pewpew@feddit.it 2 points 1 week ago

Ok fair point. I mainly code in C for making GBA games and random projects, so I haven't done much multithreaded work

[–] fruitcantfly@programming.dev 2 points 1 week ago* (last edited 1 week ago) (1 children)

Rust has no Undefined Behaviour.

That is simply not true. See here for a list of behavior that is considered undefined in Rust: https://doc.rust-lang.org/reference/behavior-considered-undefined.html

However, most (all?) of these require the use of unsafe, which helps narrow down where the problem might be, if you trigger any of this behavior

[–] HaraldvonBlauzahn@feddit.org 3 points 1 week ago* (last edited 1 week ago)

That is simply not true.

Yeah that is correct.

I was thinking in Safe Rust alone, and actually forgot about Unsafe Rust.

Because I have so far almost never used Unsafe Rust, except for C library bindings.

[–] zaphod@sopuli.xyz 1 points 1 week ago (1 children)

I searched for about six weeks how to fix that and it disappeared when I changed the position of the program’s data segment.

So it was a linker issue? I wouldn't call that undefined behaviour in multithreaded code.

But industry is still working with a fifty year old language written for systems where 32 kilobytes were a lot of memory.

Especially for embedded and DSP stuff there are so many architectures that aren't even supported by the Rust compiler. And on those systems 32 kiB of RAM is sometimes a lot of memory.

[–] HaraldvonBlauzahn@feddit.org 1 points 1 week ago

So it was a linker issue?

No, that would have resulted in a linker error, not random undefined behaviour

But industry is still working with a fifty year old language written for systems where 32 kilobytes were a lot of memory.

Especially for embedded and DSP stuff there are so many architectures that aren't even supported by the Rust compiler. And on those systems 32 kiB of RAM is sometimes a lot of memory.

These niches still exist but they get rapidly smaller every year. Because:

  • Cheap hardware gets more powerful
  • Demands rise... even some electric toothbrushes are networked now
  • Rust support for embedded devices is rapidly expanding

Plus:

  • In some domains, security is becoming a real issue
[–] Auli@lemmy.ca 3 points 1 week ago (1 children)

Also really easy to introduce bugs. But from how everyone online talks about being good developers is all you need. I don't know how those bugs get there in the first place.

[–] HaraldvonBlauzahn@feddit.org 4 points 1 week ago* (last edited 1 week ago) (1 children)

I don’t know how those bugs get there in the first place.

Easy to explain.

Visualizing program code as cables, this is how a shiny new program would look:

And this how, for example in a commercial environment, or if the programmers are not absolute masters, such a program will look after 15 years of bug fixing, feature requests, urgent changes, deadlines, and unfinished restructurings:

The thing is that especially C code contains tons of implicit invariants which you simply cannot maintain in such code.

And don't forgot that the picture above shows perhaps 500 cables, but a codebase can easily contain 50000 lines of code....

load more comments (1 replies)
load more comments (20 replies)
[–] Artemis_Mystique@lemmy.ml 1 points 1 week ago* (last edited 1 week ago) (1 children)

50 years later and we are still asking "To C or not to C, that is the question" personally i dont like nanny compilers telling me how to write, warnings are much more helpful to nudge me in the right direction.

load more comments (1 replies)
[–] hoshikarakitaridia@lemmy.world -2 points 1 week ago (2 children)

Interesting, that's a real change to the last discussion in the email chains where they kind pushed rust out of the core development and said they would need to fork the kernel / make their own smaller modules to bs adopted.

I still remember one of the maintainers leaving over concerns about multiple languages in the kernel and Linus Torvalds having to chime in personally to set the new direction.

load more comments (2 replies)
load more comments
view more: ‹ prev next ›