Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!lins From: lins@Apple.COM (Chuck Lins) Newsgroups: comp.sys.mac.programmer Subject: Re: MPW Linker wish... Summary: It supports Modula-2 with help from compiler Keywords: Modula-2, MPW, Linker Message-ID: <47309@apple.Apple.COM> Date: 12 Dec 90 19:00:36 GMT References: <2506.276672e0@waikato.ac.nz> Organization: Apple Computer Inc., Cupertino, CA Lines: 50 In article <2506.276672e0@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes: >Wouldn't it be nice if the MPW Linker supported Modula-2 and like-minded >languages? Specifically, it should do the following: > >* Automatically sort initialization code for modules into the right > sequence, based on their import relationships (if A imports B > which imports C, then C should initialize before B, which in turn > should initialize before A). An intelligent compiler will do this 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. Yes, I know you'd like to see this happen automatically for all modules in an app. But the linker first has to be aware of initialization code and it must be identified in the .o file. Not technically difficult, but 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. >* Check for and *disallow* circular imports (I don't care what > Niklaus Wirth says, circular imports are wrong)--if A imports > B which imports C which imports A, then this is an error. > All right--it should at least be a warning. I don't know what the new Modula-2 standard will say, but this will probably end up being more important than what Prof. Wirth thinks. Especially since the good Professor has moved onto to something called Oberon. Of course, you can't have circular imports in Oberon :-) >* Support checking of compilation dates/times on modules, so that > if A and B import C, the Linker can check that they import > the same version of C (to ensure that both A and B are recompiled > if the interface to C has changed). Compilers can do this now by exporting a dictionary record consisting of the module name and the module key (timestamp). Of course, the linker can't tell you what version was really expected however. Which is why I expect you'd like to see support in the linker. Ideally, the Make file should catch this and recompile for you. > >was part of a standalone Modula-2 implementation that ran on a PDP-11 >(I think this was *the* original Modula-2 implementation). It was >a neat little system--sigh... The original Modula-2 system was created on the Lilith by Prof. Wirth. -- Chuck Lins | "Is this the kind of work you'd like to do?" Apple Computer, Inc. | -- Front 242 20525 Mariani Avenue | Internet: lins@apple.com Mail Stop 37-BD | AppleLink: LINS@applelink.apple.com Cupertino, CA 95014 | "Self-proclaimed Object Oberon Evangelist" The intersection of Apple's ideas and my ideas yields the empty set.