2 ms·
> Writing performance-critical programs can be frustrating because optimizing compilers for imperative languages tend to be unpredictable. A fun example: C opt
by MaxBarraclough 6y ago
> Writing performance-critical programs can be frustrating because optimizing compilers for imperative languages tend to be unpredictable.
A fun example: C optimisers are sometimes permitted to optimise away infinite loops. (This is due to the interesting way C is defined, rather than anything inherent to imperative programming.)
https://news.ycombinator.com/item?id=13640636 https://news.ycombinator.com/item?id=13640636
- CodesInChaos 6y agoAlso the rules for this are different between C and C++. In C `while(1){}` cannot be removed, while in C++ it can.