From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 12 Sep 1995 18:02:18 -0400 From: Martin Weitzel Martin.Weitzel@rent-a-guru.de Subject: aux/depend Topicbox-Message-UUID: 23f0b402-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19950912220218.pnCZ6m_hSrh8E4t0MXmJ4VPr-jt7jUQPr_vwG0R0LMw@z> > We run one of the netlib sites. Netlib is a library of > free software, papers, and other useful stuff mostly > of a mathematical nature. Each directory in netlib > contains a .depend file that lists what symbols are > exported from each file in the directory and the > external symbols which that file references. What brings up a related question. I wonder why Plan 9 still uses the special `ar'-format for object module libraries. If ordinary directories were used instead, there would be no need to remember the syntax of `ar'-commands for maintaining libraries and it would also simplify updating libraries with `mk'. I considered the idea to use directories for object modules instead of archives more than once under Unix (especially after long fights with the shortcomings of the special rules for updating libraries with `make' :-/). Sometimes I wondered(*) why so much special stuff was put into `make', instead of making `ld'(**) recognize a directory as object module library. Like in an archive there could even be a `__.SYMDEF'-File in a directory to speed up the search. *: As so often, the answer might be `for historical reasons', another answer might be that archives did use the disk space more efficiently in the ancient days. **: There is no need to modify `ld' internally to implement that. Some time ago I wrote an awk-script to generate the file arguments for `ld' based on the `nm'-output of the `.o'-files. In that way I circumvented the clumsy library update through `make'-rules.) > Depend mirrors the nelib directory structure. In each > directory appears a file for each symbol exported by > a program (as listed in .depend). Reading one of these > files yields the transitive closure of all the files > needed to resolve that symbol. > It's a way of giving someone what they asked for instead > of the whole contents of the directory. The mechanism described above looks very promising and powerful, because it is more general than a special case for `ld'. What I always missed under Unix are `true libraries for interpreted languages'. E.g., it would be nice if a number of (private or public) `standard functions' for shell- or awk-scripts could be placed into separate files and have all the required files automatically included in scripts as they are finally executed. A description of the dependencies between the files, combined with a transitive closure, both much like described above, would be necessary to pull in exactly the required files from the library (but no more!). To summarize: I think the idea behind "aux/depend" is well worth to be considered in more detail, because it not only could help to get rid of `ar'-archives and their special treatment in `mk' and `ld', but would also help to have a general library features available for all interpreted languages. --Martin