2 ms·
GCC switched to C++ for the same reason Linux uses C extensions; the base language doesn’t adequately support the target problem domain.
by turndown 3y ago
GCC switched to C++ for the same reason Linux uses C extensions; the base language doesn’t adequately support the target problem domain.
- sylware 3y agoThe problems are c++ and C gcc extensions now.
- turndown 3y agoYou are allowed to think that and in some ways they are, but both exist due to problems in C itself. Lack of interest in evolving C at a reasonable pace has left the standard catching up to the implementations where there is no such ideological battle to implement a feature. The attribute situation in C is a great example of this.
- sylware 3y agoI do disagree, and actually that type or reasoning is, on the long run, leading straight to significant planned obsolescence and vendor/developer lock-in once tools get of significant complexity and size (which is the de-facto case with c++ and similar due to the inherent complexity of their syntax). This is no ideological battle, but a sanity/toxicity, and in some context, strategic battle. But I concede that it looks like an ethical battle from far away. And I agree on the fact that C is bad, but much less worse than c++ and similar, plain and simple C (without the latest ISO tantrums) is still the less worse compromise. And if something had to be done with C, it was the "other way around": only 1 loop statement (loop{}), no integer promotion, no switch enum typedef (and the filthy _generic and typeof), no implicit cast except from literals (see rust and others) and void*, hard compiler constant declarations, fix for good the variable argument list macro, no anonymous code block (but ok for union and struct), only sized primary types (u8/s8...u64/s64...f32...), and all those pesky little things I forget. We did reach a state in our domain where "innovation" is actually not "adding and complexifying" (unless Big Tech, since this is their bread and butter), but "removing", and the really hard part, then, to keep it that way.