News for hackers. Stuff that matters.
Re:“C is quirky, flawed, and an enormous success” – Dennis R... by falcrist on Sunday July 09, 2023 @06:39AM (#36653328)
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.

Re:“C is quirky, flawed, and an enormous success” – Dennis R... by pjmlp on Sunday July 09, 2023 @04:09PM (#36658377)
Are the Arduino and ESP32 microcontrollers?

Hint, might check their libraries/SDKs before answering.

Re:“C is quirky, flawed, and an enormous success” – Dennis R... by bathMarm0t on Sunday July 09, 2023 @07:34PM (#36660196)
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)

Re:“C is quirky, flawed, and an enormous success” – Dennis R... by pjmlp on Monday July 10, 2023 @01:11AM (#36662373)
So it isn't only C.
Re:“C is quirky, flawed, and an enormous success” – Dennis R... by falcrist on Monday July 10, 2023 @08:58AM (#36665695)
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.

Re:“C is quirky, flawed, and an enormous success” – Dennis R... by pjmlp on Monday July 10, 2023 @09:53AM (#36666453)
I wasn't the one making an universal truth out of it.

"Their libraries are written in/for C"

Re:“C is quirky, flawed, and an enormous success” – Dennis R... by falcrist on Monday July 10, 2023 @11:22AM (#36667752)
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.

Re:“C is quirky, flawed, and an enormous success” – Dennis R... by pjmlp on Monday July 10, 2023 @12:23PM (#36668610)
It is not, because they use C++.

I avoid whatever I feel like.

Re:“C is quirky, flawed, and an enormous success” – Dennis R... by falcrist on Monday July 10, 2023 @01:57PM (#36670313)
Atmel 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.

Re:“C is quirky, flawed, and an enormous success” – Dennis R... by pjmlp on Monday July 10, 2023 @02:33PM (#36670945)
"1. Yes they are microcontrollers.

2. Yes they use C/C++"

So how it is?

Re:“C is quirky, flawed, and an enormous success” – Dennis R... by falcrist on Monday July 10, 2023 @02:45PM (#36671110)
The things you mentioned aren't both microcontrollers, and they use C.

Why continue to double down when you clearly have no idea what you're talking about?

Re:“C is quirky, flawed, and an enormous success” – Dennis R... by pjmlp on Monday July 10, 2023 @05:27PM (#36673208)
So are you taking back the original answer?

Those are not my words.

Re:“C is quirky, flawed, and an enormous success” – Dennis R... by falcrist on Tuesday July 11, 2023 @08:43AM (#36680191)
No.

The things you mentioned aren't both microcontrollers, and they use C.

Why continue to double down when you clearly have no idea what you're talking about?

Re:“C is quirky, flawed, and an enormous success” – Dennis R... by falcrist on Monday July 10, 2023 @08:56AM (#36665676)
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.

Re:“C is quirky, flawed, and an enormous success” – Dennis R... by pjmlp on Monday July 10, 2023 @09:53AM (#36666469)
Whatever you are forced to chose doesn't make the other options disappear from the market.
Re:“C is quirky, flawed, and an enormous success” – Dennis R... by falcrist on Monday July 10, 2023 @11:22AM (#36667744)
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.