[r6rs-discuss] [OT] Should compilers preserve termination?

Mikael Tillenius mti at tillenius.com
Fri Mar 9 04:10:31 EST 2007


bear wrote:
> But the other camp says that "we presume that the code is
> error-free; if the only non-error result is known in
> advance, we may optimize the process by eliding the
> computation."
>   
It seems that some people here think that an infinite loop is by 
definition an error. I don't agree with this. As a programmer I quite 
often find myself writing infinite loop on purpose. Often (but not 
always) they have some kind of side-effect, like printing something.

I think that a language that would allow optimizing away loops with 
side-effects would be plain stupid. Optimizing away infinite loops 
without side-effects would only be irritating and would violate the 
principle of least surprise.

/Mikael




More information about the r6rs-discuss mailing list