Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!spdcc!esegue!compilers-sender From: moss@cs.umass.edu (Eliot Moss) Newsgroups: comp.compilers Subject: Re: compiler generators. Keywords: code, design, C, Modula, GCC Message-ID: Date: 4 Oct 90 13:33:37 GMT References: <90255.105510VMDOS@tecmtyvm.mty.itesm.mx> <1852@tuvie> <1990Oct1.044328.8051@acc.stolaf.edu> <1898@tuvie> Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: moss@cs.umass.edu (Eliot Moss) Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst) Lines: 35 Approved: compilers@esegue.segue.boston.ma.us In-Reply-To: mike@vlsivie.at's message of 3 Oct 90 11:45:46 GMT In case my previous posting did not make it clear, I would agree with the statement that the amount of work needed on the tree part of gcc to incorporate a "new" programming language would be related to its semantic similarity to C. Note, though, that what we are really saying is whether the "new" language has similar fundamental data types and control structures. Type checking rules, coercions, etc., can vary quite a bit without affecting the tree work that much. Another way of putting it is that the approach can be expected to work well for imperative languages in the C, Pascal, Modula, Ada, etc., tradition. In handling Modula-3 the most difficult things appear to be exception handling (not too bad), garbage collection (more difficult), and use before declaration (which means you need to process entire modules before resolving definitions). This latter item does not affect the tree data structure all that much, but rather the front-end control structure, which must build an entire tree, resolve definitions, and then generate RTL, rather than generating (and discarding) tree stuff one statement at a time. (There are other ways of doing the two passes, but the essential difference is between a one-pass and two-pass front-end; the back end does many "passes" of course, but on smaller collections of RTL, and each pass is a specialist.) Hope this clarifies things a bit more. I think that the gcc base could readily be used to build (for example) and Ada compiler, but it is probably not a good starting point for (say) Lisp or Smalltalk .... Eliot Moss -- J. Eliot B. Moss, Assistant Professor Department of Computer and Information Science Lederle Graduate Research Center University of Massachusetts Amherst, MA 01003 (413) 545-4206; Moss@cs.umass.edu -- Send compilers articles to compilers@esegue.segue.boston.ma.us {ima | spdcc | world}!esegue. Meta-mail to compilers-request@esegue.