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

Programmer Humor

37448 readers
6 users here now

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

Rules:

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

C is meant for embedded stuff. #changemymind

[–] davel@lemmy.ml 14 points 2 years ago* (last edited 2 years ago) (3 children)
[–] dohpaz42@lemmy.world 17 points 2 years ago (2 children)

That article is incomplete. Nowhere do I see JavaScript listed.

[–] davel@lemmy.ml 15 points 2 years ago* (last edited 2 years ago)

😂

node-os is a full operating system built on top of the linux kernel

[–] jubilationtcornpone@sh.itjust.works 8 points 2 years ago* (last edited 2 years ago)

It seems the cancer has metastasized. First to the backend, now to the entire operating system.

[–] Venator@lemmy.nz 7 points 2 years ago (3 children)

Ease of access to the underlying hardware in your programming language is only ever needed for embedded programming in the current year. Change my mind.

[–] ShortN0te@lemmy.ml 9 points 2 years ago (2 children)

There are actual use cases where direct memory access and pointer magic can be very efficient or almost necessary. We work a lot with large images and basically always the first steps are some pointer operations.

[–] rwhitisissle@lemmy.ml 2 points 2 years ago

What kind of pointer operations?

[–] Venator@lemmy.nz 0 points 2 years ago* (last edited 2 years ago)

Sounds like you just need a bigger graphics card to me. 😂

[–] marcos@lemmy.world 8 points 2 years ago (1 children)

It's required for drivers too.

[–] Venator@lemmy.nz 1 points 2 years ago

That's basically embedded programming, or pretty similar.

[–] davel@lemmy.ml 6 points 2 years ago* (last edited 2 years ago)

Every operating system running on bare metal needs access to the hardware. And if not on bare metal, it needs access to the virtual hardware.

[–] ShortN0te@lemmy.ml 6 points 2 years ago

Exactly for that a memory safe language would avoid so many security vulnerabilities.

[–] excitingburp@lemmy.world 2 points 2 years 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 2 years ago (4 children)

Even for small 4/8 bit soc systems?

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

[–] fl42v@lemmy.ml 2 points 2 years ago* (last edited 2 years 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

[–] Bene7rddso@feddit.de 2 points 2 years ago

There's Assembly for those

[–] Jordan_U@lemmy.ml 2 points 2 years 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.

[–] excitingburp@lemmy.world 1 points 2 years 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 2 years ago

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

[–] Jordan_U@lemmy.ml 2 points 2 years ago

For years I wrote embedded C for 8 bit microcontrollers used in industrial controls.

Never again.

Rust is by far a better language for embedded. The only times I would consider it reasonable to write embedded code in C is if you're doing it for fun, or you depend on an existing and well tested / audited codebase or library and your application logic is less complicated than rust to C FFI.

Even then, you won't find me contributing to that effort.

[–] frezik@midwest.social 1 points 2 years ago

Rust is making inroads.

Or micropython. That might sound nuts, but consider that Python was released two years after the 486 and two years before the Pentium. The RP2040 microcontroller has a far higher clock rate than those, has dual cores, and costs a dollar. It may lack RAM compared to some of those desktops at the time, though.