The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
To: tuhs@tuhs.org
Subject: Re: [TUHS] better ways and termcap vs. terminfo for commentary)
Date: Tue, 17 Sep 2019 08:48:28 +1000	[thread overview]
Message-ID: <20190916224825.keswxb7sh224tpky@localhost.localdomain> (raw)
In-Reply-To: <201909162047.x8GKlSbX001635@darkstar.fourwinds.com>


[-- Attachment #1.1: Type: text/plain, Size: 3253 bytes --]

At 2019-09-16T13:47:27-0700, Jon Steinhart wrote:
> G. Branden Robinson writes:
> >         _info_nol "> \033[46m\033[30mSTATUS:\033[0m "
> >
> > Why write something portable when you can be "close to the metal"?  :-/
> >
> > I gently steer people to better ways when the occasion presents itself.
[...]
> 
> We can have an interesting discussion of the definition of "better ways".

Here I think we have a layering violation.  Why on earth would a CPU
microarchitectural flaw detector need to know or care about the details
terminal control sequences?

_Anything_ that provides an abstraction of the terminal is an
improvement on the above.

> I see termcap as a great solution for the days in which there was
> little standardization.

Setting aside the specificity of "termcap", sure.  Something was needed
to gather up the absurd efflorescence of implementation details among
hardware terminals and present programmers (and users struggling to
interact with the system) something simpler and more intention-oriented.

You want "bold, if the device can do it", not a giant switch statement
encompassing '\033[1m', '\033ya', '\033yA', '\033<', '\2331m', '\033[1m'
with a parameter after it, '\033[7m', \033[=15F', ...

And if the device _can't_ do bold, you want to be able to decide for
yourself whether you don't care if the boldness is left out, or be able
to query that interface layer about it and program your own fallback
(use indentation, full capitalization, an "IMPORTANT:" prefix, etc.) in
the event the capability is absent.

> But it's probably pretty hard to find a non-conforming terminal
> nowadays so I think that it's better to avoid obfuscation.

I've attached an example of the sort of thing I do.  It has a lot of
comments, so is inappropriate for inlining on a list full of Unix
grognards.  ;-)

> Were it me I would have a comment that referenced the page and section
> number in the standard.

This is a good idea, but its benefit can be limited for ISO standards,
which are often paywalled.  In this case the controlling standard is
ISO 6429.  Fortunately it's largely parallel to ECMA-48 which is freely
available.  In this case you want ECMA-48, pp. 61-63[1].

> Since we like debating the merits of old technology, somebody can kick
> off a termcap versus terminfo discussion :-)

terminfo is better than termcap in the same way that Fortran 77 is
better than Microsoft BASIC for 8-bit microcomputers--identifier length.

Fortran 77, 6 characters.
MS BASIC, 2.
termcap, 2.
terminfo, 5.

Of course, that argument could be turned around rather precisely for
those who prize "terseness".

I reckon one of the reasons that function names in the Unix kernel were
allowed to grow as long as they did--while still being limited to 6
characters for linkage reasons--was because the precious space of 1-
and 2-letter external identifiers was held sacrosanct for user programs.

There but for that grace would 'swtch()' have gone as 'sw()', and
'creat()' as 'cr()', perhaps.

No such considerations availed in the namespace for executable programs.
;-)

Regards,
Branden

[1] https://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf


[-- Attachment #1.2: example.sh --]
[-- Type: application/x-sh, Size: 2029 bytes --]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2019-09-16 22:49 UTC|newest]

Thread overview: 125+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13  3:20 [TUHS] My EuroBSDcon talk (preview " Warner Losh
2019-09-13  9:03 ` Branden Robinson
2019-09-13 19:47 ` Clem Cole
2019-09-13 20:02   ` Clem Cole
2019-09-13 20:06     ` Clem Cole
2019-09-13 20:24       ` Jon Steinhart
2019-09-13 20:43         ` Clem Cole
2019-09-13 20:53           ` Diomidis Spinellis
2019-09-13 21:45             ` Clem Cole
2019-09-13 22:13               ` [TUHS] earliest Unix roff Warren Toomey
2019-09-13 22:55                 ` Clem Cole
2019-09-14  2:02                   ` Larry McVoy
2019-09-14  2:44                     ` Warren Toomey
2019-09-15  2:56                       ` U'll Be King of the Stars
2019-09-15  6:54                         ` arnold
2019-09-15  7:01                           ` Dave Horsfall
2019-09-15 16:17                             ` Jon Steinhart
2019-09-15 17:23                               ` Ronald Natalie
2019-09-15 19:48                             ` Clem Cole
2019-09-15 21:16                               ` Dave Horsfall
2019-09-15  7:32                           ` U'll Be King of the Stars
2019-09-15  7:46                             ` arnold
2019-09-15 19:37                           ` Clem Cole
2019-09-16  5:52                             ` arnold
2019-09-16 12:10                               ` Clem Cole
2019-09-16 12:26                                 ` Lars Brinkhoff
2019-09-16 13:42                                   ` Clem Cole
2019-09-16 14:54                                     ` Larry McVoy
2019-09-16 16:09                                     ` Paul Winalski
2019-09-16 22:05                                     ` Dave Horsfall
2019-09-16 22:33                                       ` reed
2019-09-17  0:11                                         ` Dave Horsfall
2019-09-17  0:02                                       ` Nemo Nusquam
2019-09-17  0:21                                         ` Arthur Krewat
2019-09-17 11:12                                         ` Thomas Paulsen
2019-09-17  0:46                                       ` Clem Cole
2019-09-16 13:13                                 ` Chet Ramey
2019-09-16 14:51                                 ` Larry McVoy
2019-09-16 14:57                                   ` Clem Cole
2019-09-16 15:14                                     ` Richard Salz
2019-09-16 15:48                                       ` Ronald Natalie
2019-09-16 16:10                                       ` Larry McVoy
2019-09-16 16:16                                         ` Jon Steinhart
2019-09-16 16:26                                           ` Larry McVoy
2019-09-16 16:31                                             ` Richard Salz
2019-09-16 16:45                                               ` Larry McVoy
2019-09-16 17:19                                                 ` KatolaZ
2019-09-16 17:24                                                   ` Larry McVoy
2019-09-16 17:32                                                     ` Jon Steinhart
2019-09-16 17:35                                                     ` Clem Cole
2019-09-16 17:37                                                   ` Jon Steinhart
2019-09-16 18:09                                                     ` [TUHS] [OT] " KatolaZ
2019-09-16 18:19                                                       ` Jon Steinhart
2019-09-16 18:04                                                   ` [TUHS] " Chet Ramey
2019-09-16 18:19                                                     ` KatolaZ
2019-09-16 23:24                                                     ` Dave Horsfall
2019-09-16 17:24                                                 ` Clem Cole
2019-09-16 17:00                                               ` Clem Cole
2019-09-17 11:20                                         ` Thomas Paulsen
2019-09-16 19:13                                       ` Steffen Nurpmeso
2019-09-16 19:31                                       ` Bakul Shah
2019-09-16 22:35                                     ` Dave Horsfall
2019-09-17  7:53                                   ` arnold
2019-09-17 14:21                                     ` Clem Cole
2019-09-17 15:03                                       ` arnold
2019-09-17 15:58                                     ` Christopher Browne
2019-09-17 18:15                                       ` arnold
2019-09-17 18:32                                         ` Warner Losh
2019-09-18  0:42                                         ` Adam Thornton
2019-09-16 21:42                                 ` Dave Horsfall
2019-09-16 21:48                                   ` Larry McVoy
2019-09-16 21:54                                     ` Jon Steinhart
2019-09-16 21:59                                       ` Larry McVoy
2019-09-17  5:07                                         ` Lars Brinkhoff
2019-09-16 22:10                                       ` Bakul Shah
2019-09-17  0:16                                   ` Greg 'groggy' Lehey
2019-09-17  0:31                                     ` Jon Steinhart
2019-09-17 12:20                                     ` David
2019-10-05 19:44                                 ` Michael Parson
2019-09-15 19:35                         ` Clem Cole
2019-09-15 20:49                           ` U'll Be King of the Stars
2019-09-16  6:20                             ` arnold
2019-09-16 12:13                               ` Clem Cole
2019-09-16 12:34                                 ` arnold
2019-09-16 14:52                                 ` Larry McVoy
2019-09-17  0:10                               ` [TUHS] O'Reilly groff macros (was: earliest Unix roff) Greg 'groggy' Lehey
2019-09-17  0:51                                 ` Clem Cole
2019-09-17  0:54                                   ` [TUHS] O'Reilly groff macros U'll Be King of the Stars
2019-09-17  1:03                                     ` Clem Cole
2019-09-17  1:41                                     ` Greg 'groggy' Lehey
2019-09-17  1:58                                       ` Clem cole
2019-09-15 19:27                       ` [TUHS] earliest Unix roff Clem Cole
2019-09-15 19:31                         ` Jon Steinhart
2019-09-14  7:35               ` [TUHS] My EuroBSDcon talk (preview for commentary) Diomidis Spinellis
2019-09-13 21:31       ` Clem Cole
2019-09-17 19:29         ` Warner Losh
2019-09-17 20:17           ` Clem Cole
2019-09-17 19:18       ` Warner Losh
2019-09-17 20:13         ` Clem Cole
2019-09-13 20:06     ` Larry McVoy
2019-09-14  6:13   ` Wesley Parish
2019-09-15 21:46 ` Clem Cole
2019-09-15 23:25   ` Bakul Shah
2019-09-15 23:35     ` Clem cole
2019-09-16  1:42     ` Warner Losh
2019-09-16  1:52       ` Clem cole
2019-09-16  2:05         ` George Michaelson
2019-09-16  2:37           ` Bakul Shah
2019-09-16  3:29             ` [TUHS] INed/Rand Editor/Ned [was " Charles H. Sauer
2019-09-16 14:53               ` Clem Cole
2019-09-16 16:16                 ` Warner Losh
2019-09-16 20:21                   ` G. Branden Robinson
2019-09-16 20:47                     ` Jon Steinhart
2019-09-16 22:33                       ` George Michaelson
2019-09-16 23:14                         ` G. Branden Robinson
2019-10-09  1:10                         ` Lyndon Nerenberg
2019-09-16 22:48                       ` G. Branden Robinson [this message]
2019-09-17 11:46                     ` Theodore Y. Ts'o
2019-09-17 12:52                       ` G. Branden Robinson
2019-10-09  0:38                   ` Lyndon Nerenberg
2019-09-16  1:31   ` [TUHS] " William Pechter
2019-09-16  1:48     ` Clem cole
2019-09-16  2:24     ` Dave Horsfall
2019-09-16  2:31       ` Toby Thain
2019-09-16  3:36   ` Theodore Y. Ts'o

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=20190916224825.keswxb7sh224tpky@localhost.localdomain \
    --to=g.branden.robinson@gmail.com \
    --cc=tuhs@tuhs.org \
    /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).