Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Maybe you should explain to Andreas how C++ was such a bad choice for SerenityOS. Or to authors of the various RTOSes coded in it.


It's not impossible. Other people have done it. Some have done it with a minimal kernel or micro-kernel in C and then services on top of that in C++. Just doing a quick perusal of their code base, the low level stuff is functions and structs. So, yes, it is a .cpp but not that different from the code you'd write if it were a .c. And it appears they're turning off exceptions and the standard library (which is completely reasonable). They probably have some additional coding standard (internally) like you can't use anything with a constructor in certain contexts, etc.

And on a validated RTOS - it might be in C++ under the covers. The examples that come to my mind aren't. But the world is a big and magical place, so I can't say for certain on every RTOS. The F35 uses C++ and a set of very restrictive internal coding standards built on https://en.wikipedia.org/wiki/MISRA_C.

And no one will die if their copy of Serenity OS crashes.


If it is compiled by a C++ compiler, it is C++ regardless of the language features being used.

Regarding language guides, C doesn't stop being C, even when castrated via MISRA-C.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: