Lisp to C conversion

Walter Bright bright at dataioDataio.UUCP
Fri Dec 13 04:04:31 AEST 1985

In article <124000003 at ima.UUCP> johnl at ima.UUCP writes:
>It's not hard for a
>compiler to tell that some piece of a program has no inputs, and once it's
>figured that out, it can compute the result of that piece at compile time
>and substitute its result.

Programs that have no inputs tend to fall into two groups:

	o Benchmarks.

	o Programs that are to be run only once per recompilation.

In either case, it doesn't seem worthwhile to compute the program
output at compile-time.

As for parts of programs that have no inputs, or the inputs are always
known, this is a major focus of global flow optimization techniques.
Unfortunately, I have yet to see one powerful enough that worked
across loops (I'd love to see one that could optimize the notorious
sieve benchmark down to printf("1899 primes\n");).

I've also seen some work on attempting to determine when run-time
array bounds checking could be safely eliminated. Of course, the
corollary is that out-of-bounds detection could be accomplished
at compile-time... but I'm dreaming on.

More information about the Comp.lang.c mailing list