5 ms·
Microcontrollers exist. Their libraries are written in/for C. The programs running on them are small and need tight, efficient memory management. I also like t
by falcrist 3y ago
Microcontrollers exist. Their libraries are written in/for C. The programs running on them are small and need tight, efficient memory management.
I also like the minimalist nature of the language itself. I get that for desktop applications, you usually want more integration with the operating system so you can say "I want a window here and a button here" rather than having to manually build the window from scratch, but that's not something that's a concern in most embedded systems.
I'm operating in a world of voltage inputs and outputs, memory mapped devices, registers, flags, and timings... with almost nothing between me and the hardware. A simple language makes a lot of sense here.
- pjmlp 3y agoAre the Arduino and ESP32 microcontrollers? Hint, might check their libraries/SDKs before answering.
- bathMarm0t 3y agoDon't think I'm too crazy but last time I checked: 1. Yes they are microcontrollers. 2. Yes they use C/C++. (check the libraries/SDKs, 1 layer under the hood it's all .h/.cpp files, and most of the arduino calls are just #defines)
- pjmlp 3y agoSo it isn't only C.
- falcrist 3y agoIt absolutely is only C on the microcontrollers I'm doing work on. I don't understand why you're trying to cherry-pick like this.
- pjmlp 3y agoI wasn't the one making an universal truth out of it. "Their libraries are written in/for C"
- falcrist 3y agoThe statement you quoted is true of both of the examples you gave. Also, you've deliberately chosen a specific interpretation of my statement in order to manufacture an argument that doesn't exist. You should probably avoid doing that in the future.
- pjmlp 3y agoIt is not, because they use C++. I avoid whatever I feel like.
- falcrist 3y agoAtmel and Xtensa have libraries in C. It's almost like I have some domain knowledge that you don't. Imagine coming in here with examples that aren't even microcontrollers as if that "debunks" what I said above. Like somehow magically I can just switch to a whole different platform. No problem, just crank out a new board spin and swap my whole toolchain over so I can... what... use a non-standard version of C in the arduino IDE for production code? If you think THAT'S a viable option, you've lost your mind. Why continue to double down when you clearly have no idea what you're talking about? > I avoid whatever I feel like. You should "feel like" avoiding inventing arguments that hinge on misinterpretations of other people's statements. The fact that you don't makes you a problem. Meanwhile, I can't avoid C even if I "feel like it"... because I write code for microcontrollers... which have libraries that are written in and for C.
- pjmlp 3y ago"1. Yes they are microcontrollers. 2. Yes they use C/C++" So how it is?
- 3y ago
- falcrist 3y agoArduino is a platform, not a microcontroller. ESP32 is technically a microcontroller, but it's an SOC... which is not the kind that generally gets used for industrial applications in the field I'm in. You shouldn't assume I get to choose the platform I'm working on. That's not how it works where I'm at, and if (when) I do get to choose, programming language is unlikely to be near the top of the list of criteria.