Hacker News new | ask | show | jobs
by falcrist 1069 days 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.

1 comments

Are the Arduino and ESP32 microcontrollers?

Hint, might check their libraries/SDKs before answering.

Arduino 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.

Whatever you are forced to chose doesn't make the other options disappear from the market.
The other options aren't relevant to my comment.

If you're going to be pedantic, you need to be both relevant and correct. You are neither.

Don'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)

So it isn't only C.
It 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.

I wasn't the one making an universal truth out of it.

"Their libraries are written in/for C"

The 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.