Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ihnp4!qantel!hplabs!sdcrdcf!usc-oberon!brand!barad From: barad@brand.UUCP (Herb Barad) Newsgroups: net.lang.mod2 Subject: Re: ETH Modula2 Single Pass Message-ID: <308@brand.UUCP> Date: Tue, 23-Sep-86 12:24:44 EDT Article-I.D.: brand.308 Posted: Tue Sep 23 12:24:44 1986 Date-Received: Tue, 30-Sep-86 05:13:05 EDT References: <6@fornax.uucp> <5@f.gp.cs.cmu.edu> Reply-To: barad@brand.UUCP (Herb Barad) Distribution: net Organization: U. of So. Calif., Los Angeles Lines: 74 Keywords: ETH MacMETH one-pass In article <5@f.gp.cs.cmu.edu> rpd@f.gp.cs.cmu.edu (Richard Draves) writes: >I don't believe a true one-pass Modula-2 compiler is possible. >I have some experience with the language, having implemented >the front-end (first-pass) for a compiler. I have also discussed >this issue with Mike Powell, implementor of the famed Powell compiler, >and he concurs. > Yes, the compiler is possible. In fact, I have used it. This is sometimes called the Heitz compiler as Wener Heitz (sorry about name spelling) as well as good ol' Nick W. worked on it. I know many who are using the Lillith version and love it. I have used the Macintosh version called "MacMETH" - beware as this version as SERIOUS BUGS. I have had Keith Poole from Modula Corp help me out and he agrees that the Mac version has serious bugs. Modula Corp does not get any support from ETH on this product, so he can't help me out. I have also found serious bugs in MacModula-2 (all versions) dealing with their handling of processes (coroutines). You have to remember that the definition of the language has changed (again, sigh!) for the one-pass compiler. There are no export statements as everything in the definition module is exported. Coroutines are no longer part of the definition of the language - but many implementation will still have them I hope. One great thing about it - IT IS FAST. MacMETH compiles about 40-100 times faster than MacModula-2. I suppose similar speed-ups are obtained elsewhere... By the way, about the Powell compiler - I have also hit some serious bugs there. I have been able to call procedures with the wrong number of arguments and it links! How did this happend? Well, I was changing a module around and made the number of parameters in some procedure calls different. Some people came around to distract me and we went out to lunch... Later, I forgot to change the module that holds the calls to these changed procedures and I ran my makefile. Well, my makefile was not made properly, so all it did was recompile the files that had been edited and linked them - successfully!!! It did not do any checking for me. I realize that this goof was initially my fault (almost all bugs are), but a strictly typed language such as Modula-2 is suppose to check this... Since everything compiled and linked, it took me quite a long time to track this down with the debugger. >The problem is that identifiers may be used in statements before they >are declared (although identifiers used in declarations must be declared >before use). Page 145 of the 3rd edition of Wirth's book is very clear. >You may think a back-patching scheme can overcome this, but I have some >sample programs that I think can convince anyone that the problems with >such an approach are intractable. > >Does this purported one-pass compiler compile the whole language or a subset? >If it does compile the whole language, does anyone know how it accomplishes >this in a single pass? Let me mention that reading a program into memory, >perhaps in the form of a syntax tree, and then generating code is *not* >one pass. > This I don't know about - I suppose you might contact the people at ETH and/or Modula Corp for an answer. -- Herb Barad [USC - Signal and Image Processing Institute] USENET: ...!sdcrdcf!usc-oberon!brand!barad or ...!mcvax!seismo!sdcsvax!sdcrdcf!usc-oberon!brand!barad ARPANET: barad@brand.usc.edu USMail: Univ. of Southern California Powell Hall 306, MC-0272 Los Angeles, CA 90089-0272 phone: (213) 743-0911