[gambit-list] Viewing CPS expansion?

Taylor R Campbell campbell at mumble.net
Fri May 22 15:38:28 EDT 2009


   Date: Fri, 22 May 2009 12:18:49 -0700
   From: "D.McClain" <dbm at asyrmatos.com>

   Very interesting... I would like to see your claims backed up by  
   actual measurements.

How about an isomorphism between the set of direct-style Scheme
programs and (a subset of) the set of CPS Scheme programs?  Then if
you give me a compiler C, I can construct a compiler C' that uses a
CPS intermediate representation and such that C(P) = C'(P) for any
program P.  No measurement is necessary to observe that the code
generated by C and C' is identical.

Put another way, turning a program into CPS doesn't add to or remove
from the information in a program.  So it doesn't make a compiler any
more or less able to make assumptions about a program that enable it
to generate better or worse code.  All it changes is how convenient it
is to write the compiler.  It's just a way to lay out some data
structures in the compiler.  If someone told you that a compiler
turned programs into an XML-based intermediate representation, would
you believe that person if he claimed that the use of XML caused the
compiler to generate bad code?  (It might be indicative of incompetent
software engineering on the part of the compiler's writers, but that's
a different issue.)


More information about the Gambit-list mailing list