POSIX bashing (readline bashing)

Robert Heiss rob at wilbur.coyote.trw.com
Sat Mar 30 17:27:33 AEST 1991


In article <70319 at brunix.UUCP> cgy at cs.brown.edu (Curtis Yarvin) writes:
[cooked mode bashing...]
>
>Cooked mode is obsolete.  It was originally an efficiency hack to reduce I/O
>processing; this has long been a marginal optimisation.  Any text interface
>written today should use the GNU "readline" libraries, or an equivalent.
>

Call me a Luddite, but I think readline is overkill.  We have lots of small
programs with command line interfaces, and there was an experiment with
readline, and here's my opinion of it:

1.  Readline is a disk space pig.  The readline library is larger than the
    entire Bourne shell executable.  Thus every little program which uses
    it will be around 100K bytes or more.

2.  Readline is a memory pig.  Since readline messes with heap memory
    allocation, there is a potential memory leak at every prompt.

3.  Readline is a CPU pig.  Piping a batch file into a command line is
    slower when the program uses readline.

4a. Readline is a documentation pig.  Until the standard cooked mode and
    the supported shells have compatible features, the documentation for
    each program must cover the readline stuff too.  And thoroughly too;
    you can't just mention EMACS or some crufty experimental shell and
    expect that Joe User has the commands memorized.

4b. Readline violates the principle of least surprise.  Since Joe User
    doesn't have documentation or help for the readline features, he is
    baffled when mistyping a magic character exposes some complex and
    stateful behavior.

5.  Typing readline commands accidentally at a non-readline prompt can
    cause major unwanted effects on other computer systems.  On the other
    hand, backspace seems to be universally portable.  (except to EMACS :-)

6.  Readline is CS friendly, not user friendly.  It makes the computer
    more interesting without providing meaningful productivity improvement.

The delete-character feature of cooked mode is necessary and sufficient
for command line editing.  Kill-line is the next most useful feature.
They're good enough to get the job done.

-----
Robert Heiss  rob at wilbur.coyote.trw.com



More information about the Comp.unix.wizards mailing list