Computer Old Farts Forum
 help / color / mirror / Atom feed
From: imp at bsdimp.com (Warner Losh)
Subject: [COFF] Other OSes?
Date: Sun, 8 Jul 2018 21:52:09 -0600	[thread overview]
Message-ID: <CANCZdfpz=bT2Kf=4VsCFWMn8Ev_mHd+U=w9P7j1yFU1MA71e7Q@mail.gmail.com> (raw)
In-Reply-To: <a8de7802-095d-41b5-de7a-7b6fc13554be@spamtrap.tnetconsulting.net>

I've often thought it a mistake to have main() be the only entry point.
There's a simple elegance in that, I'll grant, but if there were a
parse_args() entry point that also allowed for completion that was called
before main, and that you'd only proceed to main on a complete command
line, you could easily put the burdon of command line completion into the
programs. They know that arg3 is a filename or a sub command or a network
interface or an alternate name of cthulhu. tcsh does command completion,
but in a half-assed, gotta know about all the commands and have a giant
table that duplicates all the programs in the system's parsers, which isn't
scalable. It's had that since this 80's as has bash, and both have been
lame equally as long. It would also let the program do 'noise words' like
TOPS-20 did w/o having to actually parse them...

clang --complete is an interesting variation on my ideas within the realm
of doing non-standard weird things and starts to place the burden of
knowledge on the program itself, which is more in line with the thinking of
Unix and the main stream of OOish thought we've know about since the early
70s with smalltalk and other such pioneering things.

Then again, maybe my idea is too much influenced by TOPS-20 commands that
became resident to do command completion, then ran more quickly because
they were already at least half-loaded when the user hit return.

Warner

On Sun, Jul 8, 2018 at 9:43 PM, Grant Taylor via COFF <coff at minnie.tuhs.org>
wrote:

> On 07/08/2018 09:35 PM, Dan Cross wrote:
>
>> Back in the days of line editors, which read their commands from the
>> standard input and were relatively simple programs as far as their user
>> interface was concerned, you could put a set of editor commands into a file
>> and run it sort of like a shell script. This way, you could run the same
>> sequence of commands against (potentially) many files. Think something like:
>>
>
> ACK
>
> I figured that you were referring to something like that.  But I wanted to
> ask in case there was something else that I didn't know about but could
> benefit from knowing.  I.e. vimscript.
>
> $ cat >scr.ed
>> g/unix/s/unix/Unix/g
>> w
>> q
>> ^D
>> $ for f in *.ms; do ed $f << scr.ed; done; unset f
>> ...
>>
>
> Nice global command.  Run the substitution (globally on the line) on any
> line containing "unix".  I like it.  ;-)
>
> The double << is different than what I would expect.  I wonder if that's
> specific to the shell or appending to the input after the file?
>
> Back in the days of teletypes, line editors were of course the only things
>> we had. When we moved to glass TTYs with cursor addressing we got richer
>> user interfaces, but with those came more complex input handling (often
>> reading directly from the terminal in "raw" mode), which meant that
>> scripting the editor was harder, as you usually couldn't just redirect a
>> file into its stdin.
>>
>
> That makes sense.  Thank you for the explanation.
>
>
>
> --
> Grant. . . .
> unix || die
>
>
> _______________________________________________
> COFF mailing list
> COFF at minnie.tuhs.org
> https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/coff/attachments/20180708/83c040d5/attachment.html>


  reply	other threads:[~2018-07-09  3:52 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-05  5:56 wkt
2018-07-05  6:29 ` spedraja
2018-07-05  6:40 ` bakul
2018-07-05 15:23   ` clemc
2018-07-05 20:49     ` scj
2018-07-05 21:25       ` david
2018-07-06 15:42         ` gtaylor
2018-07-05 22:38       ` ralph
2018-07-05 23:11       ` bakul
2018-07-06  0:06         ` lm
2018-07-06 15:49           ` gtaylor
2018-07-06  0:52       ` tytso
2018-07-06  5:59         ` ralph
2018-07-06 15:59           ` gtaylor
2018-07-06 16:10             ` ralph
2018-07-06 16:47               ` gtaylor
2018-07-06 15:57         ` gtaylor
2018-07-06 15:38       ` gtaylor
2018-07-09  1:56         ` tytso
2018-07-09  3:25           ` gtaylor
2018-07-09  3:35             ` crossd
2018-07-09  3:43               ` gtaylor
2018-07-09  3:52                 ` imp [this message]
2018-07-09 11:32                   ` perry
2018-07-09 11:50                     ` perry
2018-07-09 11:34                 ` crossd
2018-07-09  5:23             ` tytso
2018-07-09 12:52               ` clemc
2018-07-09 13:06                 ` [COFF] PiDP Obsolesces Guaranteed clemc
2018-07-09 14:39                 ` [COFF] Other OSes? tytso
2018-07-09 14:46                   ` clemc
2018-07-09 11:24           ` perry
2018-07-05 22:51   ` ewayte
2018-07-08 20:31   ` perry
2018-07-08 20:53     ` perry
2018-07-09  2:44     ` crossd
2018-07-10  5:30       ` bakul
2018-07-16 14:49         ` crossd
2018-07-16 16:59           ` [COFF] Capabilities (was " bakul
2018-07-06  0:55 ` [COFF] " crossd
2018-07-06  5:42   ` bakul
2018-07-09  2:51     ` crossd
2018-07-10  5:41       ` bakul
2018-07-06  4:04 ` grog
2018-07-06 16:10   ` gtaylor
2018-07-06 18:27     ` [COFF] Editor Scripts scj
2018-07-06 19:04       ` gtaylor
2018-07-08 20:50 ` [COFF] Other OSes? perry
2018-07-08 23:27   ` bakul
2018-07-09  0:00     ` grog
2018-07-09  0:13       ` perry
2018-07-09  0:05     ` crossd
2018-07-09  0:56       ` lm
2018-07-09  2:23         ` crossd
2018-07-09  0:11     ` perry
2018-07-09  0:19       ` crossd
2018-07-09  2:00         ` bakul
2018-07-09  3:02           ` [COFF] Origination of awful security design [COFF, COFF] bill
2018-07-09 13:10           ` [COFF] Other OSes? david
2018-07-09 13:17           ` perry
2018-07-09 13:13         ` perry

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='CANCZdfpz=bT2Kf=4VsCFWMn8Ev_mHd+U=w9P7j1yFU1MA71e7Q@mail.gmail.com' \
    --to=coff@minnie.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).