9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Martin Weitzel Martin.Weitzel@rent-a-guru.de
Subject: aux/depend
Date: Tue, 12 Sep 1995 18:02:18 -0400	[thread overview]
Message-ID: <19950912220218.pnCZ6m_hSrh8E4t0MXmJ4VPr-jt7jUQPr_vwG0R0LMw@z> (raw)

> 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






             reply	other threads:[~1995-09-12 22:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-09-12 22:02 Martin [this message]
  -- strict thread matches above, loose matches on Subject: below --
1995-09-13 12:52 aux/depend presotto
1995-09-12 22:53 aux/depend forsyth
1995-09-12 21:23 aux/depend Jeremy
1995-09-12 15:16 aux/depend presotto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19950912220218.pnCZ6m_hSrh8E4t0MXmJ4VPr-jt7jUQPr_vwG0R0LMw@z \
    --to=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).