I'd just like to interject for moment. What you're refering to as C++, is in fact, C/C++, or as I've recently taken to calling it, C plus plus plus. C++ is not a programming language unto itself, but rather another free component of a fully functioning C system made useful by the C stdlibs, C preprocessor and vital build system components comprising a full language as defined by ANSI.

Many compiler users run a modified version of the C language every day, without realizing it. Through a peculia

@nanoha this is actually a good question, is it possible to meaningfully run a system on C++ but without C at all?

@whitequark @nanoha

C++ lets you compile C, doesn't it?

@munin @nanoha nope, common misconception! e.g. `new` is a valid variable name in C but not in C++

@whitequark @nanoha

Huh. I could have sworn you could get mixed C/C++ codebases in. Wonder why my head had that.

@nanoha @whitequark

....oh, I bet it's the linker letting you pull in stuff from C libraries, isn't it.

@munin @nanoha Both. You can mix C and C++ code in different compilation units as long as you tell C++ to use the C ABI (extern "C"), and *also* you can write polyglot code that compiles both as C and as C++ and does the same thing, but the latter is by no means completely trivial as the languages differ semantically quite a bit as well.
@nanoha @munin If you look into your system headers, you'll see chunks of
#ifdef __cplusplus
extern "C" {
#endif
at the beginning and the closing version of it at the end; this is so that #include <stdio.h> links to the right (non-mangled) function names when you use it in a C++ compilation unit.

@whitequark @nanoha

....wait, theoretically that means I could use the C versions of libraries in a C++ program?

@munin @nanoha Of course. Pretty much every C++ program in existence in fact does that, as it uses the C library, libc. The majority of platform libraries like winapi or gtk are also in C.

@whitequark @nanoha

I don't know how I didn't realize that years ago...

@munin @nanoha semi-related: TIL character literals in C (like 'a') have the type int

@whitequark @nanoha

....huh. I think I may have known that at some point, but now I'm wondering whether that applies outside the ASCII range.

@whitequark @nanoha

The latter sounds like it would lead to all kinds of madness, so I'm naturally going to have to attempt it sometime - though I've not seriously touched C++ since the 1990s...

The former must have been what I was thinking about.

@nanoha I certainly did write an OS kernel in pure C++, and LLVM/clang do not have any components in C, so if you just directly implemented the OS APIs in terms of C++ you'd be fine
@nanoha no no no no. *cough* it's Linux plus GNU! *rolls eyes*