this post was submitted on 16 Jul 2023
474 points (100.0% liked)

Programmer Humor

854 readers
6 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

No offence

you are viewing a single comment's thread
view the rest of the comments
[–] Ret2libsanity@infosec.pub 54 points 1 year ago (3 children)

C is the sniper you don’t see

[–] Maultasche@feddit.de 9 points 1 year ago (1 children)

And just like in Metal Gear, he dies of old age if you wait a bit.

[–] unicorn@mander.xyz 19 points 1 year ago (5 children)

C is old, ubiquitous and still does not have a good replacement for its low-level cross-platform usecases, so I'll believe it when I see it 😄

[–] ursakhiin 8 points 1 year ago (3 children)

Rust is doing a very decent job of low-level cross platform. C just has a very long history.

[–] unicorn@mander.xyz 5 points 1 year ago

Its cross-platform support (not just for using but also for building it) is not there yet, and it is quite huge and unstandardized with only one full implementation. I'd agree the last part will change with age, but given the frequent large changes and feature additions I am afraid it will be harder and harder and it is simply too complex and fast-moving for many low-level applications. It is closer to C++ than C in my eyes. I'd be happy seeing it replace C++ though for its memory safety benefits!

[–] Ret2libsanity@infosec.pub 1 points 1 year ago (2 children)

Rust won’t replace c.

The programs are too bloated for many embedded systems where every byte counts because it’s in ROM or loaded jnto IRAM

All that memory safety and garbage collection, for example, comes at a big cost

[–] Auburn 1 points 1 year ago

Rust actually doesn't have a garbage collector! The point of Rust is that memory safety is statically verified at compile time, automatically inserting allocations and frees. The bloat of Rust binaries in my experience comes from excessive code generation such as generics or macros. If you're aware of that, though, you can avoid the more bloaty bits (such as the string formatting machinery) and compile some quite tiny binaries. For example, I was able to write a simple GameBoy Advance game that only took 2kb of ROM including the assets.

That said, C still very much has its place, but Rust can definitely do embedded.

[–] Faresh@lemmy.ml 1 points 1 year ago

garbage collection

I don't think Rust has a garbage collector.

[–] jlh@lemmy.jlh.name 1 points 1 year ago

At the same time, C is the only stable ABI available for Rust.

[–] Rodeo@lemmy.ca 1 points 1 year ago

Ada has been around since 1983 and is objectively superior. Yes I will die on that hill.

It's too bad programmers are all such egotards they think they can write bugfree programs in C, while whining about how "restrictive" a safe language like Ada is.

load more comments (3 replies)
[–] hglman@lemmy.ml 5 points 1 year ago

C is back at HQ with 2 Stars and enough political capital to serve till they die.

load more comments (1 replies)