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

Linux

66623 readers
604 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
you are viewing a single comment's thread
view the rest of the comments
[–] pewpew@feddit.it 4 points 1 week ago (5 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

[–] iopq@lemmy.world 26 points 1 week ago (3 children)

Yes, C syntax is easy understand

[–] SineSwiper@discuss.tchncs.de 10 points 1 week ago

I'm a Perl programmer. This C syntax is fucked.

[–] Nalivai@lemmy.world 6 points 1 week ago (1 children)

The first picture isn't what people write, even though it's technically compilable, it's not what C is.
The second is a normal syntax, pretty simple to understand if you write enough code.
C is very simple language at it's core, and it allows for it to be used in a very complicated systems.

[–] iopq@lemmy.world 1 points 6 days ago (1 children)

Nobody is arguing C is complex. The argument is that it's not the optimal syntax.

For example, case statements needing breaks can cause logical issues with incorrect merges.

How about this

https://en.wikipedia.org/wiki/Unreachable_code#goto_fail_bug

The if statement not requiring brackets caused this bug. Rust fixes these issues with pattern matching and mandatory curly braces in if body statements

[–] Nalivai@lemmy.world 1 points 6 days ago* (last edited 6 days ago) (1 children)

Yeah, it's not optimal, I don't think anyone argues that it is. It has a bunch of ways to shot yourself in the foot, no questions about that, people were writing books about that for decades. Not like there is an optimal language that doesn't allow you to make some stupid mistakes.
But also, a lot of that non-optimality is what gives it advantage. Well, that and enormous amount of legacy code and expertise.
Sometimes you need to pass around raw pointers without caring about memory ownership, and for that situation it's optimal. I'm glad you have your mandatory curly brackets, but sometimes I just want my microcontroller to blink an LED and for that I'm in turn glad that I can be as quick and dirty as my filthy mind allows me.
And for serious projects we're all MISRA compliant anyway, and it mandates curly brackets for ifs and proper cases for switch.

[–] iopq@lemmy.world 1 points 5 days ago (1 children)

Let's not get too abstract. Just because Rust made its own mistakes doesn't mean it didn't fix the mistakes I pointed out

Serious projects have huge memory safety issues that don't exist in Rust. More than half of security CVEs are due to the nature of C. Rust just has fewer bugs like Heartbleed because it doesn't let you do a buffer overrun

[–] Nalivai@lemmy.world 1 points 5 days ago (1 children)

that don’t exist in Rust

That's because serious projects basically don't exist in Rust. Yet, probably, Rust seem to be a good language that people like, so those are to follow, but for now they're rare.
Or don't, if we discover that Rust has some other issue that only happens when the project grows old enough.
Personally, I'm sticking to the devil I know, the one that has almost 60 years of accumulated knowledge and best practices.

[–] iopq@lemmy.world 1 points 5 days ago (1 children)

Rustls can already replace OpenSSL, but maybe that's not serious enough for you. Sure, the ring backend embeds assembly for the crypto operations, but that's the point:

You can have a safe interface for interacting with potentially unsafe code. Do all of the memory allocation and string manipulation stuff in Rust and call out to crypto in assembly

[–] Nalivai@lemmy.world 1 points 5 days ago (1 children)

Yeah, it's not serious enough for me. It will become serious if it actually replaces openssl, or at least actually is in use by any significant numbers. Until then, it's a project that can potentially maybe sometimes be used by someone maybe, which by definition isn't serious. Like any other project, it needs time under pressure, it needs to mature with use, be supported for some time, accept patches and changes, and sustain constant prodding by people who would like to break your stuff.
OpenSSL is a standard for almost 3 decades, Rustls is cautiously maybe being pushed in experimental branches.
It's like that with everything Rust related really. We are at a phase where enthusiasts enthusiastically trying to convince someone to consider their new toy, which means we can't really compare it with decades old projects that were scrutinized and stress-tested by millions of people.

[–] iopq@lemmy.world 1 points 5 days ago (1 children)

OpenSSL has proven itself to be security issue riddled, unmaintainable, bloated. It's only lasted so long because people had the impression it was good, but it has proven itself unreliable

[–] Nalivai@lemmy.world 1 points 4 days ago (1 children)

Paraphrasing, there are only two types of important projects, security issue riddled, unmaintainable, bloated ones, and those that nobody uses.

[–] iopq@lemmy.world 1 points 2 days ago (1 children)

That doesn't mean things can't get better. Rust is a step in the right direction

[–] Nalivai@lemmy.world 1 points 1 day ago

Hope so. But I will be convinced when it passes through the growing phase.

[–] slacktoid@lemmy.ml 22 points 1 week ago (1 children)

Rust requires you to unlearn some of the C and CPP habits. And so it's like learning a language that approaches things differently. That is pretty fun to see how another language solves a problem etc. I think rust is a very fun and interesting language tbh. But you are free to not like it, that's all good man. That's why we have different languages. After getting into rust, for me, you need to convince me to use C or Cpp, they have their niches for sure, but rust allows that too like embedded programming etc.

This checks out. I tried some Rust coding challenges and couldn't get my stuff to compile mostly. When I see the solution it seems straightforward but also not intuitive.

[–] asdfasdfasdf@lemmy.world 6 points 1 week ago (1 children)

Rust us way easier to understand for me (and I'd guess most people) than C.

Rust is fun because it's the only mainstream language with an affine type system, which allows some really cool patterns like the typestate pattern. And the fact that there's no inheritance or null or exceptions is amazing.

[–] iopq@lemmy.world 2 points 6 days ago

I don't use languages that can subvert the type system with null, it's an obvious flaw

[–] 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....

[–] iopq@lemmy.world 1 points 6 days ago

50K? You kidding me? Our shitty shopping cart application is 300K lines of code plus html/css

It's mostly php