On Sat, Aug 02, 2014 at 02:04:22AM +0200, Timon Gehr via Digitalmars-d wrote: > On 08/02/2014 01:52 AM, H. S. Teoh via Digitalmars-d wrote: > >On Sat, Aug 02, 2014 at 01:47:42AM +0200, Timon Gehr via Digitalmars-d wrote: > >>On 08/02/2014 01:03 AM, H. S. Teoh via Digitalmars-d wrote: > >>>Actually, I'm thinking of ways of extending this even further, ... > >> > >>Note that the official stance has been that such things are > >>obviously ridiculous if not checked dynamically in non-release mode. > > > >Nothing stops the compiler in non-release mode from computing the > >expression both ways and comparing them to see if they match. > > > > > >T > > > > Side effects. Multiplication of the runtime in non-release builds.
True. I haven't really thought through how to address all those details yet. The final design may not quite behave exactly the way I described. But it's a direction I'd like to go in, because I think there's a lot of potential here. > Btw, I don't think one can use == to express those rewrites. It's just hypothetical syntax. The point is that it's a hinting system to provide extra reduction rules to the optimizer that is impractical for the compiler to automatically deduce. T -- Claiming that your operating system is the best in the world because more people use it is like saying McDonalds makes the best food in the world. -- Carl B. Constantine
