Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!snorkelwacker!spdcc!esegue!compilers-sender From: farnum@sequoia.Berkeley.EDU (Charlie Farnum) Newsgroups: comp.compilers Subject: Intermediate Languages Keywords: code,optimize Message-ID: <1990Aug09.180137.18583@esegue.segue.boston.ma.us> Date: 9 Aug 90 18:01:37 GMT Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: Charlie Farnum Organization: Compilers Central Lines: 26 Approved: compilers@esegue.segue.boston.ma.us A Scheme-like IL is the way to go. Guy Steele suggested this many moons ago (like before 1980, in one of the ``Lambda: the ultimate {imperative,declarative}'' papers), and evidence has been steadily accumulating since then. A recent reference you might want to look at is ``Compilation by Program Transformation'', Richard Kelsey's 1989 dissertation from Yale, which presents a Pascal compiler using a Scheme-ish IL. The Scheme IL community emphasizes continuation-passing style (CPS), which is convenient (but not necessary) for many of the things you need to do for Scheme and a royal pain for traditional bread-and-butter optimizations. This is unfortunate, because the non-CPS style code is perfect for many of the tree-transformation systems that are popping up, e.g., the pattern-matching code generators that have been around for several years now. (Which, by the way, don't deal very well with loop instructions; loops are very hard to canonicalize, and most IL trees don't include control flow. Of course, if people would only use Scheme style ILs... :-) ) If you would like a rough ten pages of arguments on why a Scheme-like IL is wonderful, let me know. If you'ld rather wait for the finished version, look for ``Prototyping Optimizing Compilers'', coming this December to a Tech Report list near you. /charlie -- Send compilers articles to compilers@esegue.segue.boston.ma.us {spdcc | ima | lotus| world}!esegue. Meta-mail to compilers-request@esegue.