Complexity of reallocating storage (was users command crap)

Tom Christiansen tchrist at convex.COM
Tue Feb 5 03:18:29 AEST 1991


>From the keyboard of dhesi%cirrusl at oliveb.ATC.olivetti.com (Rahul Dhesi):
:In <5883:Feb102:05:4991 at kramden.acf.nyu.edu>
:brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
:
:>Tradeoffs between ``multiple passes'' and ``single pass'' are entirely
:>irrelevant when they aren't reflected in speed, space, or human effort.
:
:It's often easier to adapt a single-pass program to handle
:previously-unforeseen needs than to similarly adapt a multipass
:program.  A good example is what happens if you decide later that you
:would like to handle standard input.  Now if you have a multipass
:implementation, you either have to completely redo it, or use a
:possibly huge temp file, or do buffering in blocks which may involve a
:heavy penalty in speed and memory usage.

Very true.  Consider Henry Spencer's fiendishly clever "nroff -man in awk"
program (awf), to my mind the pinnacle of awk programming.  He runs it in
three stages for various reasons, but this makes communication and feedback
between passes difficult at best.  See his fascinating paper on ``Awk as a
Major System's Programming Language'' in the proceedings from last month's
Dallas USENIX in which he discusses this and a bunch of other issues.

It's a similar problem, by the way, to the one that occurs in streams like:
    a | b | c | d | e | f | g | h | i > omega
It's a bummer when you realize that portions c and g need to talk
to each other.

It occurs to me that this discussion is about general programming, not
just C programming, so I've directed followups to comp.unix.programmer.
Of course, if you don't like this, edit your headers; for example, the
overly motivated might reasonably select alt.religion.computers. :-)

--tom
--
"Still waiting to read alt.fan.dan-bernstein using DBWM, Dan's own AI
window manager, which argues with you 10 weeks before resizing your window." 
### And now for the question of the month:  How do you spell relief?   Answer:
U=brnstnd at kramden.acf.nyu.edu; echo "/From: $U/h:j" >>~/News/KILL; expire -f $U



More information about the Comp.unix.programmer mailing list