14
C can be memory-safe (2023) (blog.erratasec.com)
you are viewing a single comment's thread
view the rest of the comments
[-] Croquette@sh.itjust.works 2 points 4 months ago* (last edited 4 months ago)

I'm a C dev and I don't care if C ever go extinct, but the MCU toolchains are pretty much always C/C++.

If it was for a personal project, I wouldn't mind setting up a Rust compiler, but in a work setting, the uncertainty of unofficial crates (edit: I don't sleep enough) is a no go for a product that needs to be maintained for years to come.

And even when an official toolchain will be made, it will take a moment to spread.

But I really like all the features of newer language over C, so if I have the opportunity to change language, I will take it.

[-] bhamlin@lemmy.world 4 points 4 months ago

I'm merely commenting on the fact that every time this comes up, it's just a chant of "skill issue" over and over again. The problem is that it's hard to do it correctly, and there are so many more ways to do it incorrectly.

[-] infamousta@sh.itjust.works 2 points 4 months ago* (last edited 4 months ago)

I know what you mean. I’ve been doing higher level development for a couple decades and only now really getting into embedded stuff the past year or two. I dislike a lot of what C makes necessary when dealing with memory and controlling interrupts to avoid data races.

I see rust officially supported on newer ARM Cortex processors and that sounds like it would be an awesome environment. But I’m not about to stake these projects with a hobbyist library for the 8-bit AVR processors I’m actually having to use.

Unfortunately I just have to suck it up and understand how the ECU works at the processor/instruction level and it’s fine until there are better tools (or I get to use better processors).

ETA: I’ve thought also that most of the avr headers are just register definitions and simple macros, maybe it wouldn’t be so bad to convert them to rust myself? But then it’s my library that’s probably broken lol

this post was submitted on 25 Mar 2024
14 points (69.4% liked)

C Programming Language

931 readers
24 users here now

Welcome to the C community!

C is quirky, flawed, and an enormous success.
... When I read commentary about suggestions for where C should go, I often think back and give thanks that it wasn't developed under the advice of a worldwide crowd.
... The only way to learn a new programming language is by writing programs in it.

© Dennis Ritchie

🌐 https://en.cppreference.com/w/c

founded 1 year ago
MODERATORS