Article View: comp.bugs.4bsd
Article #294Re: Complexity of reallocating storage (was users command crap)
From: Tom Christiansen
Date: Mon, 04 Feb 1991 16:18
Date: Mon, 04 Feb 1991 16:18
38 lines
2774 bytes
2774 bytes
From the keyboard of dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi):
:In <5883:Feb102:05:4991@kramden.acf.nyu.edu>
:brnstnd@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@kramden.acf.nyu.edu; echo "/From: $U/h:j" >>~/News/KILL; expire -f $U
Technical Details
Message-ID:
<1991Feb04.161829.9385@convex.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!bcm!convex!newsReferences:
<21548@yunexus.YorkU.CA> <5883:Feb102:05:4991@kramden.acf.nyu.edu> <2924@cirrusl.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!bcm!convex!news From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.bugs.4bsd,comp.lang.c,comp.unix.programmer Subject: Re: Complexity of reallocating storage (was users command crap) Message-ID: <1991Feb04.161829.9385@convex.com> Date: 4 Feb 91 16:18:29 GMT References: <21548@yunexus.YorkU.CA> <5883:Feb102:05:4991@kramden.acf.nyu.edu> <2924@cirrusl.UUCP> Sender: news@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Followup-To: comp.unix.programmer Organization: CONVEX Software Development, Richardson, TX Lines: 38 Preferred-Newsgroup: alt.fan.dan-bernstein Nntp-Posting-Host: pixel.convex.com