4 ms·
> Then you'd just repeat the Perl 5/Raku split. You'd have a "new" C++ that isn't actually C++ but it's called C++ with a different version number and people wi
by coribuci 7y ago
> Then you'd just repeat the Perl 5/Raku split. You'd have a "new" C++ that isn't actually C++ but it's called C++ with a different version number and people will then bicker for a few years until they realize that the "new" C++ isn't actually C++ and that the "old" C++ just vehemently refuses to die, so they name it something else.
Well, just FYI the "new" C++ is not the "old" C++ anymore. Languages "evolve". Try to compile an old program on the new compiler. The same is valid for other languages (C, fortran, perl).
> The C++ standards committee can standardize a backwards-incompatible "new" C++ for all I care as long as they don't call it C++.
They already do this. For C for example you have C89, C93, etc.
- theamk 7y agoHuh? Old programs on new compiler work with very minor changes and often with no changes at all. You might have to tweak some compiler flags, but this is per file. Your project can easily mix up C++ versions. Same for C - that old library in C89? Still usable in modern projects.
- pjmlp 7y agoTry to compile a library that uses gets() or K&R syntax in a C17 compiler.
- AlexeyBrin 7y agoGCC 10 has no problem building C code that uses gets(), even with the -std=c17 compilation flag. You get a warning at runtime, but that's it.
- pjmlp 7y agoGCC is one specific C compiler, it does not represent all of them.
- theamk 7y agoJust checked on gotbolt.com - clangg, icc, msvc all compile gets just fine. They also work with k&r style definitions as well. I am sure there are broken C compilers out there which don’t implement entire language. Heck, I use one sometimes. But I don’t think this proves your point at all. You need better examples.
- pjmlp 7y agoThat only proves that those compilers are not willing to follow up on everything that the standard specifies. Like always on the C and C++ community, "works on my compiler" and "what the standard states about it" is not the same.
- theamk 7y agoNo, those compilers would likely reject it, if I had activated c17 mode. But I did not -- so it worked. This is a real power of C and C++ -- each file gets its own mode. That K&R library you made in ancient time? C++98 classes? All still works and links to the modern stuff. You can be sure that whatever code you wrote today would still be usable, possibly with minor modifications, 20 years later. Sure, the compiler names and build systems will change, but the code would work.
- pjmlp 7y agoWell, from that point of view, it is also the real power of Cobol, Fortran, RPG, NEWP, Java, C#, Delphi.
- AlexeyBrin 7y agoI checked just GCC 10 and Clang 9, pretty sure MSVC will also let you use gets() since their C compiler is C89 with partial C99 support. Honestly I would've expected an error with -std=c17 -Wall -pedantic from GCC and Clang since gets() was removed in the C11/C17 standards.