Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!comp.vuw.ac.nz!waikato!ldo From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) Newsgroups: comp.sys.mac.programmer Subject: Re: MPW Linker wish... Message-ID: <2533.27691409@waikato.ac.nz> Date: 14 Dec 90 05:03:52 GMT References: <2506.276672e0@waikato.ac.nz> <47309@apple.Apple.COM> Organization: University of Waikato, Hamilton, New Zealand Lines: 46 In <47309@apple.Apple.COM>, lins@Apple.COM (Chuck Lins) says "An intelligent compiler will do [automatic ordering of initialization code] at the module level. And there are techniques which ensure that a module is initialized only once. Your compiler should be generating code to do this." I know, and it does. And I suspect nearly every Modula-2 compiler in the world uses the same technique: call the initialization code for *every* module you import, whether some other module imports it as well or not; at the other end, the initialization routine maintains a global flag which indicates if it's been called once or not, so it can avoid repeating itself on subsequent calls. It's a helluva hack, and it doesn't solve the circularity problem. Actually, it's possible to extend this quite simply to detect circularities, but you'll only pick them up this way when you come to run the program, not at link time, which is when it should be happening. "...you've got to convince the MPW team that this is important. Believe me, there's much more interest in Modula-2, etc outside of Apple than within." I didn't realize MPW was primarily meant as an in-house development environment, but never mind. "Ideally, the Make file should catch [out-of-date module symbol tables and object code] and recompile for you." Yes, but the Linker should also check, so that if I didn't get the Makefile *quite* right, I'll have some explanatory messages to tell me what went wrong, instead of a program that seems to build OK, but just acts funny. And finally, in a comment on my statement about the PDP-11 implementation of Modula-2 being the original one: "The original Modula-2 system was created on the Lilith by Prof. Wirth." Yes, but he had to port it to the Lilith from somewhere... Lawrence D'Oliveiro fone: +64-71-562-889 Computer Services Dept fax: +64-71-384-066 University of Waikato electric mail: ldo@waikato.ac.nz Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00