this post was submitted on 21 Jan 2024
783 points (93.4% liked)

Programmer Humor

32571 readers
325 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] excitingburp@lemmy.world 2 points 10 months ago (2 children)

I have used both C and Rust for embedded. Rust is significantly more enjoyable. https://embassy.dev/

C is good for nothing.

[–] umulu@lemmy.world 6 points 10 months ago (4 children)

Even for small 4/8 bit soc systems?

I had the idea that C was the go-to language for that.

[–] Bene7rddso@feddit.de 2 points 10 months ago

There's Assembly for those

[–] Jordan_U@lemmy.ml 2 points 10 months ago

Yes: https://github.com/avr-rust

When you're writing code involving global state and interrupts, and any access to an integer larger than a u8 needs to be surrounded by cli() and sei() just for guaranteed atomicity, then you will truly come to value rust's statically enforced thread / memory safety.

[–] fl42v@lemmy.ml 2 points 10 months ago* (last edited 10 months ago)

Are those still in use? With how cheap modern MCUs got, it kinda seems like it often makes more sense to get smth a bit more powerful and get the benefits of overall easier and faster development. May be wrong here, tho -- it's not like I compared numbers or something

Addit: I mean, 8 bit may easily still be a bit cheaper, yet corps will likely spend more than the difference in price paying devs

[–] excitingburp@lemmy.world 1 points 10 months ago

It probably won't do anything less than 32bit, so that's at least one thing C is good for.

[–] fleckenstein@social.lizzy.rs -1 points 10 months ago

@excitingburp @NocturnalMorning "C is good for nothing because I don't enjoy it" yea that's some big brain logic right there