3 ms·
Isn't part of the problem that no one can agree on the best subset? Compilers could provide pragmas and switches to enable projects to define their own language
by grumpyprole 5y ago
Isn't part of the problem that no one can agree on the best subset? Compilers could provide pragmas and switches to enable projects to define their own language subset.
- MaxBarraclough 5y agoA fair point, but the major C++ compilers don't make much effort in letting you define a subset to permit. For contrast, the Ada language (which is larger than C but smaller than C++) takes this idea quite seriously. There are various 'well known' subsets of Ada with interesting properties and tooling. These subsets are called profiles. There's SPARK, a very minimalist subset tailored for formal verification, and Ravenscar, for concurrent hard real-time systems. Profile compliance is checked by the compiler itself. (If I understand correctly, the profiles are defined using Ada's rough equivalent of #pragma in C and C++.) In the C and C++ worlds there are subsets like Google's C++ style guide, LLVM's C++ style guide, MISRA C, and MISRA C++, but their tools (i.e. static analysis tools to check for compliance) are generally separate from the compiler, for what that's worth.
- XorNot 5y agoThis would argue in favor of several languages. Which would be fine - maybe we need several, maybe one would clearly win out.