C++ Standard Library and OOP

Hello, I've been developing a C++ Standard Library for the Arduino IDE, mostly out of necessity, over the past few years and would like some feedback on the project and whether there is a need or any interest for such a thing in the community.

I'm a professional software engineer by day, developing industrial automation apps targeted at various embedded platforms (HMI/SCADA/DAQ,PLC type stuff). Arduinos are great for building simple lab and process automation devices like temperature/pressure controllers, valve actuators, timers, etc., and integrating those into complete systems, but the platform lacks support for modern OOP methodologies and standards.

Since I do all my development using an object-oriented approach and C++ is the 400 lb. gorilla in the room when it comes to embedded platforms (once you go C++ you never go back :joy:), I just started writing my own Standard Library. It's by no means complete, but what's there is ISO/IEC compliant and compiles without errors or warnings on most common Arduino boards (avr/samd), and no one's complained yet.

I'm looking for more complaints (I'm sure there's bugs galore). The library is on my Git at GitHub - Michael-Brodsky/PG: Rapid application development tools for avr/samd/megaavr architectures (Arduino, STMicro, Teensy).. I posted a short video on YouTube showing some of the apps I've built here: Lab Automation - YouTube. If you have an interest, get back to me and we'll take over the world in no time flat!

Parts of that library already have been ported to several Arduinos (controllers). Most Arduinos suffer from small RAM that discourages from using functions that may fail with (kind of) out of memory in a real life app, even if each functionality by itself will work.

Some discussion in the German section.

I’ve never had that issue. My OPP code is no bigger than straight C. Many people have this misconception that the “verbosity “ of C++ generates huge executables. Nothing can be further from the truth. The compiler optimizes everything away. C++ usually generates tighter and faster code. Where are some of these libraries you mentioned? All the ones I’ve tried don’t compile or are hacked copies glibc++ that also don’t compile. My stuff works. C++ OOP is just such a more robust environment IMHO.

As long as it does not require new() or reallocation of objects in a small RAM where memory fragmentation is a killer. Even FreeRTOS does not support dynamic memory if such support is not implemented by the firmware of a controller.

Static objects however are widely used in the Arduino framework.

Glad you mentioned that as my C++ lib uses only static memory, no new() or malloc(), I even avoid the Arduino String class like the plague. It does limit some of the implementation but, as an embedded developer, we never use dynamic memory anyway - among other things, the memory managers on them usually kinda suck. You should check out my repo on Git.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.