rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re:  Interesting things from the Plan 9 rc manpage
@ 1992-10-28  3:14 Paul Haahr
  1992-10-28  3:39 ` Chris Siebenmann
  0 siblings, 1 reply; 14+ messages in thread
From: Paul Haahr @ 1992-10-28  3:14 UTC (permalink / raw)
  To: rc

> It's too slow and too big.

testimony i've heard from a friend at the labs is that the startup time is
painful.  we speculated at the time that it was due to the way the environment
is treated on plan9 combined with the use of rcmain.  as i remember, on the
gnots, startup time was >1sec, reliably.  (this is all hearsay, folks, so
take it with a grain of salt.)


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Interesting things from the Plan 9 rc manpage
@ 1992-10-28 15:27 Paul Haahr
  0 siblings, 0 replies; 14+ messages in thread
From: Paul Haahr @ 1992-10-28 15:27 UTC (permalink / raw)
  To: cks; +Cc: rc

> I
> suspect that the claim that Plan 9 rc prompts only when reading
> from a terminal is inaccurate, and that if given no arguments
> it always prompts (unless given -I)

this makes sense, since the plan9 version of isatty() is likely
not to be correct, according to the documentation.


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Interesting things from the Plan 9 rc manpage
@ 1992-10-28  5:10 Chris Siebenmann
  0 siblings, 0 replies; 14+ messages in thread
From: Chris Siebenmann @ 1992-10-28  5:10 UTC (permalink / raw)
  To: rc

 Scott Schwartz asks about a performance comparison between
Duff's rc and Byron's. Unfortunately, I can't really give one;
I've only looked at Duff's rc for comparison purposes, never
for actual use (especially as it lacks a number of amenities
I use heavily, such as a prompt function). Duff's rc compiles
to a somewhat bigger binary on this machine, and seems to start
up new shells a bit slower. Contributions of benchmarks will
produce more extensive measurements for the curious; I can't
think of any good ones.

 The -I option is mentioned in the mk manpage, which says that
it runs recipies by supplying them as standard input to
'rc -e -I' (-e is omitted if errors are being ignored). I
suspect that the claim that Plan 9 rc prompts only when reading
from a terminal is inaccurate, and that if given no arguments
it always prompts (unless given -I); that would explain the
need for it and the mention in mk's manpage. Anyone know Tom Duff
well enough to send him email asking about it?

	- cks


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Interesting things from the Plan 9 rc manpage
@ 1992-10-28  4:07 Paul Haahr
  1992-10-28  4:20 ` Jeremy Fitzhardinge
  1992-10-28  4:27 ` Chris Siebenmann
  0 siblings, 2 replies; 14+ messages in thread
From: Paul Haahr @ 1992-10-28  4:07 UTC (permalink / raw)
  To: jeremy; +Cc: rc

> A new process would share the
> namespace of its parent, including /env, so there's no work that needs
> to be done by any party.

yes, but a shell typically reads its entire environment on startup, and
all those readdir(), open(), read(), and close() operations can't be free.
on the other hand, if they don't cache the environment in the shell,
every reference to an environment variable has to do 3 system calls
(open, read, close), which is painful in my mind, but maybe rob's right
when he says you shouldn't worry about system call overhead.

thinking about it, they probably have to use the latter approach, because
otherwise you can't take advantage of the sharing of environments between
processes that plan 9 offers.

anyway, this is all idle speculation.


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re:  Interesting things from the Plan 9 rc manpage
@ 1992-10-28  1:17 Byron Rakitzis
  1992-10-28  1:57 ` noel
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Byron Rakitzis @ 1992-10-28  1:17 UTC (permalink / raw)
  To: cks, rc

        -s:     Print out exit status after any command where the
                status is non-null (false).

This can be done with an appropriate fn prompt in my rc.

        -I:     Do not run interactively, regardless of whether or
                not standard input is attached to a terminal.

This can be done with "rc /dev/tty". What do they use this option
for anyway?

        It's too slow and too big.

I think that's just a Bell Labs pissing contest. Over there your macho-
ness as a programmer is measured in inverse proportion to the number
of lines of code you produce for a given task. My money says Duff's rc
is smaller and faster than any than ksh, bash, etc. :-)

(Though I would not be surprised if an implementation of rc that did
not lazily parse functions from the environment were perceived as being
slow on startup. This was a key optimization in my implementation.)


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Interesting things from the Plan 9 rc manpage
@ 1992-10-27 10:52 Chris Siebenmann
  1992-10-27 16:08 ` Scott Schwartz
  0 siblings, 1 reply; 14+ messages in thread
From: Chris Siebenmann @ 1992-10-27 10:52 UTC (permalink / raw)
  To: rc

 $" is the Plan 9 rc syntax for Byron's $^ string flattening operator.
 'if not' is still there.
 The Plan 9 rc has a number of interesting options:
	-s:	Print out exit status after any command where the
		status is non-null (false).
	-I:	Do not run interactively, regardless of whether or
		not standard input is attached to a terminal.
 -p is listed as a no-op; presumably no one has bothered implementing
it.
 There's a 'flag' builtin that lets you test, set, and clear the
status of command-line flags.

 The manual page doesn't have a FILES section, so I don't know if the
Plan 9 rc has abandoned the 'source a file on startup' approach (the
copy of Duff's rc I have sources a file, but it's moderately old).

 Interestingly, one of the entries in the BUGS section is
	It's too slow and too big.
(as well as
	There should be a way to match patterns against whole lists
	rather than just single strings.
which I think some people here have wanted in the past.)

	- cks


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~1992-10-28 15:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-10-28  3:14 Interesting things from the Plan 9 rc manpage Paul Haahr
1992-10-28  3:39 ` Chris Siebenmann
1992-10-28  4:00   ` Jeremy Fitzhardinge
  -- strict thread matches above, loose matches on Subject: below --
1992-10-28 15:27 Paul Haahr
1992-10-28  5:10 Chris Siebenmann
1992-10-28  4:07 Paul Haahr
1992-10-28  4:20 ` Jeremy Fitzhardinge
1992-10-28  4:27 ` Chris Siebenmann
1992-10-28  1:17 Byron Rakitzis
1992-10-28  1:57 ` noel
1992-10-28  1:59 ` noel
1992-10-28  5:59 ` James Matthew Farrow
1992-10-27 10:52 Chris Siebenmann
1992-10-27 16:08 ` Scott Schwartz

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).