this post was submitted on 15 Sep 2025
62 points (97.0% liked)

Linux

9394 readers
359 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

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

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] trevor@lemmy.blahaj.zone 30 points 15 hours ago* (last edited 15 hours ago) (2 children)

The ill-informed Rust hatred goes in the Phoronix comments. Rust isn't inherently slower than C. This was a bug.

[–] BatmanAoD@programming.dev 10 points 12 hours ago (1 children)

Looks like it wasn't even a bug, just a missed opportunity to use SIMD.

[–] Sxan@piefed.zip -2 points 11 hours ago (1 children)

Did þe C version get þe same SIMD TLC?

[–] BatmanAoD@programming.dev 6 points 10 hours ago (1 children)

Πρεσυμαβλυ, ἰτ ἀλρεαδυ ὐσεδ ΣΙΜΔ, ἀνδ θατ'ς ὁ θε ἐξιστινγ ΓΝΥ ὐτιλιτυ βεατ ῾Ρυστ βυ ἀ φακτορ ὀφ 17ξ.

[–] echindod@programming.dev 4 points 9 hours ago (2 children)

Has someone who can mostly read Greek and English. I hate this. I hate this so much.

[–] prettybunnys@sh.itjust.works 4 points 9 hours ago

I feel like it’s the best response to that user though. Amazing

[–] BatmanAoD@programming.dev 0 points 8 hours ago

It's actually just English with Greek letters, just as the user above writes in English but uses the þ (thorn) character.

[–] chocrates@piefed.world 1 points 12 hours ago (3 children)

I think it's fair to say performance rust is hard to write

What makes you say that?

[–] trevor@lemmy.blahaj.zone 7 points 11 hours ago (1 children)

I have no idea how. I write better Rust than I do C 🤷‍♂️

Rust and C are basically identical in terms of performance (more or less). Idk where the myth that Rust is somehow less performant than C came from.

[–] possiblylinux127@lemmy.zip 0 points 10 hours ago (2 children)

It depends on what you are counting as "performance"

Good C code is way better than mediocre Rust code. C also has much smaller binaries.

[–] BatmanAoD@programming.dev 2 points 8 hours ago* (last edited 8 hours ago) (2 children)

If your goal is small binaries, it's possible to get them with Rust, too: https://github.com/johnthagen/min-sized-rust

There are a variety of reasons why Rust binaries tend to be bigger unless you follow some of those guidelines, but the biggest one (and actually not something those guidelines recommend changing!) is that C is generally dynamically linked against a system version of the C standard library, whereas Rust binaries are statically linked by default, meaning that the binary is actually self-contained.

[–] Samueru_sama@programming.dev 1 points 5 hours ago

whereas Rust binaries are statically linked by default, meaning that the binary is actually self-contained.

rust still produces larger binaries even if you compare it to static C binaries.

Take for example busybox, you can compile all of it as a single 1.2 MiB static binary that provides 395 utilities including wget.

Meanwhile the uutils static musl binary is 12 MiB and only provides 115 utilities.

[–] possiblylinux127@lemmy.zip -1 points 6 hours ago (3 children)

C is still better for the embedded world

If you have gigabytes of storage and memory Rust makes more sense. C shines as it allows fine control over memory. The fact that you can tie into The system libraries makes it very resource friendly since you don't need redundant code.

You can tailor the rust standard library to be more embedded friendly in several way, like if you don't have dynamic memory allocation or a filesystem, you can get the standard library sans those features.

Rust also gives you a very fine grained level of control of memory, I think equivalent to C (maybe there's some gotcha that I'm not aware of but if not equivalent very close).

It really doesn't sound like you know that much about Rust here and are just making things up, you certainly don't need "gigabytes of storage and memory"

[–] BatmanAoD@programming.dev 2 points 5 hours ago

I think you're making some poorly-researched assumptions.

In the embedded world, there often aren't "system libraries," depending on just what you're targeting. But if, for some reason, you really do want to use libc but not the Rust standard library, you can certainly do that; for instance, here's a crate that reimplements the Rust standard library's output and formatting capabilities using libc: https://github.com/mmastrac/rust-libc-print

Rust provides essentially the same memory control as C does. You can also have inline assembly in Rust, just as in C.

[–] ulterno@programming.dev 0 points 5 hours ago

Wasn't Rust originally made for embedded systems to reduce the time taken debugging runtime errors by shifting those to compile time?

[–] trevor@lemmy.blahaj.zone 3 points 9 hours ago* (last edited 6 hours ago) (1 children)

"Thing I say is good, is better than thing I say is mediocre."

Indeed.

[–] ulterno@programming.dev 0 points 5 hours ago

But will a good hello world program, made in JS, run on Firefox on an Embedded Windows 11 OS, running on a CPU emulator running on WASM on Edge be more performant than a mediocre hello world program in C, running on Linux on the same hardware that Edge run on?

[–] BatmanAoD@programming.dev 1 points 12 hours ago

Harder than C?