@Peter_Scott said:
over the past 20+ years of doing this stuff
Note there are also those using c++ in the kernel 30+ years that have an opposing view. Circa 40 years ago I wrote assembly apps, TSR’s, and drivers for Dos. When Borland and Microsoft introduced the C language for the PC I enthusiastically used it and loved it and got great mileage out of it for years. Today c++20 is my language of choice in windows for both kernel and user mode. Why? Because it blows C out of the water, period.
anything other than C (no ++ variant) bleeds into a nightmare
This is a common misconception that C++ = OO. But it’s not true. When you rename your file extension from .c to .cpp the compiler doesn’t refuse to compile it because there’s no OO in it. On the contrary utilizing powerful c++ language features like a static assert or being able to use sizeof on a field is not a debugging nightmare but actually improves productivity all around. The C++ language is constantly getting refined. Not with OOP garbage, but lots of nuts and bolts basics for those writing kernel drivers. The latest c++20 language is brand new and absolutely awesome for driver developers. Some people don’t know today’s c++20 is nothing like C++ was 10 or 20 years ago. What the standards people have rolled out over the last decade is nothing short of miracles for people writing code.
Just write it in C … or assembly!
Assembly in the kernel makes no sense since sometime in the last century. Too many reasons to list. It’s not cross platform and besides just think of how unreadable your code would become trying to reorder the instructions for super scalar optimization which a c/c++ compiler does for you for free.