Dec 01, 2016

> this describes compilers for all modern languages

Yes, this is the current trend. And the results don't really justify the cost:

http://www.complang.tuwien.ac.at/kps2015/proceedings/KPS_201...

http://proebsting.cs.arizona.edu/law.html

Which is why I (roughly) agree with Daniel Bernstein's polemic "The Death of Optimizing Compilers" https://cr.yp.to/talks/2015.04.16/slides-djb-20150416-a4.pdf

(I frequently make code 10x to 1000x or more faster, and compilers' contributions to that total tend to be fairly minimal, though larger than zero and usually worthwhile. But not worth the current shenanigans and not worth having no idea how the code is going to turn out)

Oct 05, 2016

Common misconception, see Proebsting's Law, "The Death of Optimizing Compilers":

http://cr.yp.to/talks/2015%2E04%2E16/slides-djb-20150416-a4....

as well as 'What every compiler writer should know about programmers or “Optimization” based on undefined behaviour hurts performance '

http://www.complang.tuwien.ac.at/kps2015/proceedings/KPS_201...

Sep 26, 2016

More than with Swift. I routinely see 100x - 1000x and more performance difference between -O0 and -O in Swift. Considering that the optimiser doesn't give warnings or errors if it can't apply optimisations, that's out of bounds for me for a systems programming language. YMMV.

The whole UB idiocy is a different matter, though related because it's perpetrated by roughly the same group of people, for similar nonsensical and non-validated reasons. See my post http://blog.metaobject.com/2014/04/cc-osmartass.html

See also: http://www.complang.tuwien.ac.at/kps2015/proceedings/KPS_201... and Proebsting's Law.

Apr 09, 2016

Examples you listed would be better made "implementation defined." ie use RFC language with "Programmers should avoid shifting by more than the bitwidth, compilers should produce an implementation defined result, but may specify a trap in this circumstance"

What's your opinion of What every compiler writer should know about programmers? http://www.complang.tuwien.ac.at/kps2015/proceedings/KPS_201...

Mar 08, 2016

> This is one of the reasons gcc/llvm won: they don't care about that stuff. I mean, they care about performance, but not at all costs like these guys care.

Really? http://www.complang.tuwien.ac.at/kps2015/proceedings/KPS_201... https://news.ycombinator.com/item?id=11219874

While GCC and LLVM do care about implementing the standard correctly, they show little mercy to the poor developer who failed to avoid one of the many sharp corners of undefined behaviour.