Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site dataioDataio.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!uw-june!entropy!dataio!bright From: bright@dataioDataio.UUCP (Walter Bright) Newsgroups: net.lang.c Subject: Re: Lisp to C conversion Message-ID: <876@dataioDataio.UUCP> Date: Thu, 12-Dec-85 13:04:31 EST Article-I.D.: dataioDa.876 Posted: Thu Dec 12 13:04:31 1985 Date-Received: Fri, 13-Dec-85 20:38:11 EST Reply-To: bright@dataio.UUCP (Walter Bright Organization: Data I/O Corp., Redmond WA Lines: 25 In article <124000003@ima.UUCP> johnl@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.