Path: utzoo!utgpu!watmath!clyde!ima!compilers-sender From: nick@lfcs.ed.ac.uk (Nick Rothwell) Newsgroups: comp.compilers Subject: Re: Incremental Compilers Message-ID: <3257@ima.ima.isc.com> Date: 27 Jan 89 11:09:06 GMT Sender: compilers-sender@ima.ima.isc.com Reply-To: Nick Rothwell Lines: 38 Approved: compilers@ima.UUCP Charlie D. Havener (charlie@genrad.com) writes: >I would like to stimulate some discussion in this group about incremental >compilers and fine grained interpreters for block structured languages. Fine >grain means it incrementally changes the compiled or interpretive code ( like >reverse polish ) on a line by line basis instead of a file basis. >... >Does anyone know of other examples of fine grained >incremental compilers or interpreters? I presume that an interpreter for a (block structured) expression-based language would fit your criterion - or are you thinking of a situation where *a part* of a complete object (say, one line of a procedure) can be compiled and replaced in isolation? Standard ML does incremental compilation (as do many interactive systems) - expressions/declarations are compiled into functions which the compiler can then call like any other function, to evaluate them. Interestingly, the code generator itself does *not* require any nonstandard features of the language or host system: it is simply a function from lambda-expressions (an intermediate representation) to strings, the string containing the correct machine opcodes. There's a simple bootstrap call to turn a string into a function with that string's contents as code. ML is statically scoped, so there isn't really a concept of "replacement" of code - recompiled functions/modules supercede existing ones for subsequent declarations; the old declarations vanish by garbage collection as they disappear from the symbol table. Perhaps this is veering from your original subject area. I'll gladly go into further details if there's interest. Nick. -- Nick Rothwell, Laboratory for Foundations of Computer Science, Edinburgh. nick@lfcs.ed.ac.uk !mcvax!ukc!lfcs!nick -- Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.EDU Plausible paths are { decvax | harvard | yale | bbn}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request