This might be a terrible idea, but maybe it is a good time to scrap the concept of a default completely.
Wouldn't it be more future proof just to FORCE everyone to have to specify which language version they're targeting? That way when a new one is added it has absolutely no impact on the historical ones.
It isn't like c++14 is going to be the last version ever.
PS - If GCC is still in use in 2098 then things may get awkward.
>>just to FORCE everyone to have to specify which language version they're targeting?
There is a thought.
I see a lot of trouble from this proposal because the compilers and supplied libraries have a history of including extra things. Until quiet recently C++ headers would drop in C that nobody asked for. Personally, I was surprised to find that on Windows I could throw std::runtime_error.
At the end of the day a lot of code would break, because nobody is sure exactly what standard they are actually are using.
Is there a technical reason that would prevent the compiler from honoring a per-file pragma that allowed the developer to define how the code was expected to be interpreted by the compiler?
I find it terribly confusing. It means that Haskell is almost never something I can expect a lot from, but a weird combination of extensions changing to "non-standard" behaviours.
> It means that Haskell is almost never something I can expect a lot from, but a weird combination of extensions changing to "non-standard" behaviours.
I can't think of a weird combination of behaviors from extensions that would change semantics... maybe it's because I don't use that many extensions usually.
When I do they are related to type level programming and all they seem to affect is type inference.
Never confused me. In general, on a bigger project you'll have a bunch of approved extensions, and everything extra goes through very strict code review to see whether it helps more than it confuses.
I don't know whether you can, but it would be asking for trouble. Let's say you call function f in library L and get back a std::list, and then pass it to function g in library M, which linked to a different implementation of std:list. At best, that would lead to a crash.
alias c99="gcc --std=c99"
alias gc99="gcc --std=gnu99"
alias c++11="gcc --std=c++11"
alias g++11="gcc --std=gnu++11"
and so on to the compile distribution, and leave "gcc" and "g++" at their current defaults for legacy code. If the changes between the dialects are different enough to have compatibility issues, then it makes sense to actually treat them as different languages with different compilers.
Wouldn't it be more future proof just to FORCE everyone to have to specify which language version they're targeting? That way when a new one is added it has absolutely no impact on the historical ones.
It isn't like c++14 is going to be the last version ever.
PS - If GCC is still in use in 2098 then things may get awkward.