[r6rs-discuss] [OT] Should compilers preserve termination?
schlie at comcast.net
Wed Feb 28 21:40:55 EST 2007
> Joe Marshall wrote:
> I'd abandon the thread altogether, but I find this topic to be amusing to me.
> Now consider the expression (* 0 (collatz x)) Clearly this *has* to be zero
> if it is anything, but if we require it to preserve nontermination, we cannot
> optimize it.
(me too, along with the arguably seemingly odd sequence of decisions
effectively inhibiting the construction of reasonably simple standard
conforming interpreters, thereby seemingly diminishing the language's
potential applicability in various domains.)
However with respect to termination, although an expression's ultimately
returned value may be indisputable, it's often the case in control-oriented
applications that "when" (in either absolute terms or relative to other
sequential events) the value is returned, is often more important than
"what" the value is.
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.
More information about the r6rs-discuss