Optimizing (orig: Re: Lisp to C conversion)

Barry Margolin barmar at mit-eddie.UUCP
Mon Dec 9 06:03:10 AEST 1985


In article <628 at ttrdc.UUCP> levy at ttrdc.UUCP (Daniel R. Levy) writes:
>In article <10200028 at ada-uts.UUCP>, richw at ada-uts.UUCP writes:
>>That is, you tell the compiler to optimize your pi-calculating program
>>and it spews out "3.14159..."
>That would be a marvel of "artificial intelligence" -- an optimizer that
>can recognize algorithms.

Since when is an INTERPRETER considered a "marvel of artificial
intelligence"?  The original didn't say anything about the optimizer
recognizing algorithms.  It merely described an extended form of
constant folding.  A program that doesn't take any input always
generates the same answer, so it can be treated as a constant.

This reminds me of the old story of the optimizing Fortran compiler that
noticed that the program didn't have any output statementsm, so it
generated an object program that didn't bother performing the
computation!
-- 
    Barry Margolin
    ARPA: barmar at MIT-Multics
    UUCP: ..!genrad!mit-eddie!barmar



More information about the Comp.lang.c mailing list