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

From: Joe Marshall <jmarshall>
Date: Thu Mar 1 13:36:05 2007

On 2/28/07, Paul Schlie <schlie_at_comcast.net> wrote:
>
> Thereby although creating a logical loop testing for a termination condition
> prior to returning a value and thereby enabling control flow to proceed, may
> not be the best way to temporally synchronize program execution to external
> events, it's seemingly valid; and thereby seemingly only valid to optimize
> away evaluation if it can be proven to terminate exclusively based on
> synthetic state values within the context of the logical program, and not
> values imported from the outside world through I/O ports or other similar
> means for example.

This seems weird. If I were to write a loop that just ran for timing purposes,
I'd be insane to run it through an optimizing compiler.

As it stands, collatz conjecture hasn't been proven, but no divergent value has
ever been discovered. Would it be ok to optimize out the code
for the cases for which it is known to converge? Suppose a
termination proof were
found, would it be ok to optimize out the call in that case? Would it
be ok even
if someone wrote timing code that depended on such a proof not being found?

-- 
~jrm
Received on Thu Mar 01 2007 - 13:32:32 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC