Ask HN: Use C with Classes for Embedded?

  • I have a small experience with embedded systems but I once helped a team of hardware engineers switch from a "assembly-like code with loops and state machines" to C++17/20 on a very barebone platform and everyone was happy with the improvements in code quality and tools. IIRC we even used relatively advanced objects like `std::optional`. No need to shun the STL as it supposedly compiles to small code most of the time.

  • Isn't this the premise upon which Google's Pigweed (https://pigweed.dev/) operates?

  • Why not? Just stay away from anything that may allocate/free memory after system initialization, like "String".