rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Scott Schwartz <schwartz@groucho.cse.psu.edu>
To: culliton@srg.srg.af.mil (Tom Culliton x2278)
Cc: rc@hawkwind.utcs.toronto.edu
Subject: Re: Another vote for a built-in read function
Date: Sun, 19 Sep 1993 22:44:39 -0400	[thread overview]
Message-ID: <93Sep19.224452edt.2539@groucho.cse.psu.edu> (raw)
In-Reply-To: Your message of "Sun, 19 Sep 1993 15:59:21 EDT." <9309191559.aa00656@ceres.srg.af.mil>


| I suspect that there are a lot of us without easy access to that news
| group.  (or just too busy to look)  Could you summarize for us?  Or at
| least indicate which way the discussion was leaning?

Sure. There are two basic points, which I'll try to explain as best I
can given that I've only read about multics, but used some of its
descendants (prime's primos and apollo's domain).

One is that multics has pervasive dynamic linking.  The fundamental unit
of sharing is the procedure.  Any procedure in any file in your search
path can be called at any time.  Your environment is one big process,
you don't fork to run programs, you just call their entry points as
subroutines.

The second is that there is a convention of using "active functions" in
the command language.  That means that commands see of they are being
called interactively, in which case they print their output, or being
called as subroutines, in which case they pass their output back by
returning a pointer to a buffer.

The upshot is that in multics, if you have a command to read a line
named >bin>line, and >bin is in your search path, you can call it from
your program by calling a routine named line_ and it will be exactly as
if it were a "builtin", because it is.

There was an interesting discussion between Peter da Silva and Olin
Sibert over the find command.  Olin pointed out that ``find ... -exec
...'' is more multics-like than unix-like, but unix has to use xargs as
yet another performance hack, with concomitant correctness problems. 

I can post Olin's whole article or forward it to anyone who's
interested.  

(As an aside, the word "glob" in unix comes from a command in multics
named "global", making it more like globbing in zsh.)

In my view, and the reason I brought this up at all, a real problem in
Unix, and in posix like systems, is that the unit of sharing is wrong.
The best you can do is write text down pipes to forked processes.
Sometimes that is fine, but very often it is not enough, or just plain
wrong, and the rc community has encountered a perfect example of this.
Similar issues came up in comp.lang.tcl a while back.  In a unix
setting, having a language primative for doing dynamic loading is about
the best compromise you can achieve.

And now for a diatribe; please skip to the end if I'm annoying you. :-)
This wrongness is very bad because it distorts programmers ideas of what
should be reusable; in the end, nothing is.  Consider, why does ftp have
its own subroutine for doing globbing?  I mean, if you can't just call
the globbing routine in the shell, why can't you at least use the same
damn library routine?  There isn't any!  You don't need system sources
to get it right, just a libsh.a with a sensible api!  (The latter is
complicated by the fact that we insist on using a '70s vintage
programming language that has basically no support for code reuse, and
still manages to be an improvement over its "successor".)



  reply	other threads:[~1993-09-20  2:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-19 19:59 Tom Culliton x2278
1993-09-20  2:44 ` Scott Schwartz [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-09-17 19:29 Tom Culliton x2278
1993-09-17 23:18 ` Scott Schwartz
1993-09-17 18:17 gjv%atlas%cesar
1993-09-17 13:10 gjv%atlas%cesar
1993-09-17 16:58 ` Chris Siebenmann

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=93Sep19.224452edt.2539@groucho.cse.psu.edu \
    --to=schwartz@groucho.cse.psu.edu \
    --cc=culliton@srg.srg.af.mil \
    --cc=rc@hawkwind.utcs.toronto.edu \
    /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).