4 ms·
I don’t want to go too much into C vs Rust but loads of C code out there, when it comes time to manipulate strings or do something a bit complicated, ends up a
by rtpg 4y ago
I don’t want to go too much into C vs Rust but loads of C code out there, when it comes time to manipulate strings or do something a bit complicated, ends up a hacky mess.
For all the implications you are making about “move fast and break things” in web dev, at least newer tech stacks makes it easier to not completely break your data structures cuz the abstraction ceiling made doing things the right way hard.
Of course experienced C programmers “get it”, design their code in a way to avoid these pitfalls, and can right performant, correct code. I just think that it’s easier with a lot of other tools for stuff that’s just a bit complicated
- ChuckNorris89 4y agoI feel you're mixing things up. Not every embedded application requires parsing strings or JSONs like you do with web frameworks. AVRs and 8 bit chips in general are mostly used in various fixed point numerical control applications like CNC, industrial automation, elevator control, and white goods for the home like washing machines, HVAC, and microwave ovens, so for that they're perfect and so is C. All they do is read some buttons and sensors, crunch some basic math, run a state machine, and turn some motors, LEDs and relays ON and OFF. That's it. Complex string manipulations is something you'll never see on an AVR chip in such production applications.
- jjoonathan 4y agoFixed point is a perfect example of an abstraction ceiling that makes it unnecessarily hard to do the right thing. At first it's fine, but then you'll want to do some filtering, and then some coefficient buckets will start to overflow, and then you'll start tracking exponents, and before you know it you've sunk engineer months or years into an ugly, buggy, underpowered reinvention of floating point numbers.
- ChuckNorris89 4y agoI've shipped safety critical motor control embedded software that runs flawlessly on thousands of cars using only fixed point math without it being ugly, buggy or underpowered, precisely because everything was computed only in fixed point fractional math. You're just making up FUD.
- jjoonathan 4y ago"It was good enough for me, so it should be good enough for everybody." Lol.
- otter-rock 4y agoSeems like you didn't need fixed point in the first place. It's for when you need guarantees.
- scoutt 4y agoI've worked on dozens of embedded projects that don't need string manipulation. Or just outputting some log string through a serial port, which is removed in release. Why do you think you'll need to process input strings? > just a bit complicated Like what? Most embedded projects don't use concurrency, or even dynamic allocations. Not every projects is a hackable bluetooth/wifi stack, that you need Rust otherwise [insert favourite exploit FUD here]. It can be as simple as a toothbrush with two buttons and a motor.
- deleted 4y ago[deleted]
- rtpg 4y agoI’m just talking about business logic and data structures. It seems fine to want to not have bugs in principle! Though to your point when we’re talking about 8-bit microprocessors the amount of complications that could even be placed. I just feel like it’s totally normal to feel lacking when writing/reading certain kinds of code in C.
- scoutt 4y ago> business logic and data structures. It seems fine to want to not have bugs in principle! I think there is no (embedded) language so far which prevents you from having bugs in business logic.
- pjmlp 4y agoThose Python programmers scared of learning C, can also use certified Pascal and BASIC compilers then. https://www.mikroe.com/mikropascal https://www.mikroe.com/mikropascal https://www.mikroe.com/mikrobasic https://www.mikroe.com/mikrobasic