4 ms·
> An infinite loop should compile to an infinite loop. I think that a compiler option should control this. It can be a nice optimization, but the programmer sh
by ibobev 13d ago
> An infinite loop should compile to an infinite loop.
I think that a compiler option should control this. It can be a nice optimization, but the programmer should be able to opt out.
- Xirdus 13d agoThe programmer can opt out by terminating the loop.
- WalterBright 13d agoEvery flag that changes the semantics of the code bifurcates the language into two languages.
- ibobev 13d agoIf we accept this definition, C++ already seems to be many different languages. At my job, I'm currently fighting floating-point determinism issues across different build configurations, compilers, CPUs, operating systems, and standard library and libm implementations so that snapshot tests pass with the same hashes on all platforms. I can confirm that this is a complete nightmare.
- WalterBright 13d agoYup. I tried hard to not allow D's behaviors to be changed based on a compiler switch. Yes, we have switches to enable certain features, but not silent behavior changes. It's not perfect, but the forest of such switches in C compilers motivated D to not have them.
- cryptonector 13d agoAlternatively every flag that changes the semantics of the code is a workaround for either legacy code no one will fix or language committee decisions that have unintended side effects.
- WalterBright 13d agoAre C/C++ chars signed or unsigned? What a mess!
- nrr 11d agoThe state of affairs in C and C++ is abhorrently bad. Not only is there `char` but also `signed char` and `unsigned char`, and the standards seem to leave the signedness interpretation of bare `char` up to the implementation. Ada explicitly settled on `Character` being an enumeration type based on a specific character set encoding. When I learned Ada 95, the ARM specified the ISO 8859-1 character set for `Character`, likewise with `Wide_Character` and `Wide_Wide_Character` explicitly settling on 16- and 32-bit implementations of UCS. I wish more language specifications made decisions like this. D following suit with tying its `char`, `wchar`, and `dchar` to UTF-8, UTF-16, and UTF-32 is commendable.