The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Christopher Browne <cbbrowne@gmail.com>
To: Warren Toomey <wkt@tuhs.org>
Cc: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: Re: [TUHS] OK, keep going on type checking
Date: Mon, 13 Jan 2020 17:38:03 -0500	[thread overview]
Message-ID: <CAFNqd5XpYDtva-MQ_78ssZUt_qpwavhORajJvMiqzCt99+ooNQ@mail.gmail.com> (raw)
In-Reply-To: <20200113021303.GA7633@minnie.tuhs.org>

[-- Attachment #1: Type: text/plain, Size: 3097 bytes --]

On Sun, 12 Jan 2020 at 21:13, Warren Toomey <wkt@tuhs.org> wrote:

> All, I've had a few subscribers argue that the type checking
> thread was still Unix-related, so feel free to keep posting
> here in TUHS. But if it does drift away to non-Unix areas,
> please pass it over to COFF.
>
> Thanks & apologies for being too trigger-happy!
>

Discussion is just busy enough that it's good to keep things somewhat on
track :-).

I have something that has been lurking on my ToDo list that's on this trail
in what I'd think is a relevant way :-)
~/GitWeb> task project:shell | cat
ID Active Age Project Tag  Description Urg
-- ------ --- ------- ---- ----------- ----
24 2w     4w  shell   unix Oh Types      14

Oh is a claimant to the notion of trying to evolve shells to "better."
https://github.com/michaelmacinnis/oh

The name is probably not for the best, but it seems interesting.
MacInnis noted several problems common to shells, and somewhat
strong typing falls into the set of would-be solutions.  He noticed that
there have been lots of attempts to create shells that are embedded
in other languages, which seems universally to lead to them falling
into being curiosities.  Embedding scripts in Lisp or Python or Perl
never seems to turn out.  The pains he points at are...
- Undefined variables lead to bugs.  set -e -u and such may help, but are
optional...
- automatically varadic functions can easily just lose parameters
- splitting lists on whitespace blows up when files are allowed to have
spaces in their names
- return values intentionally look like process return codes, which can be
good, or not...
- global variables are mostly all you have, preventing having much
modularity
- variable expansions/rewrites have sometimes tortured syntax

He built a shell that has a Scheme lying in behind (which I partly like,
and partly
find suspicious).  Mechanisms to address the above are:
- data and code have the same syntax (conses)
- a richer type set (strings, symbols, return codes, a number tower of
Int/Float/Rational, lists, environments)
- first class environments that support modularity
- Fexprs (see John N Shutt's thesis, vau: the ultimate abstraction) allow
implementing your own control structures
- dynamic communications patterns (Rob Pike did a paper on this, on Squeak)
The early bits point at Scheme; dynamic comm points at Go channels, and the
shell is written in Go.

I have had this percolating in my head the last few weeks, and I watched
the recent
conversation about what ":" means with interest, as Oh makes interesting
use of :,
using it to indicate that the remaining portion of a command line is to be
evaluated/expanded, thus:
oh$ write: div 65536 256 2 (add 4 3)
128/7
oh$ define lc3: quote: a b c
oh$ echo $lc3
a b c

For a wee while, I was getting quite tortured by its interpretation (that I
had not yet internalized) of :

I have been unable as of yet to decide if the author's on to something, or
if this is a mere curiosity.
-- 
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"

[-- Attachment #2: Type: text/html, Size: 4784 bytes --]

  reply	other threads:[~2020-01-13 22:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13  2:13 Warren Toomey
2020-01-13 22:38 ` Christopher Browne [this message]
2020-01-14  1:58   ` Richard Salz

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=CAFNqd5XpYDtva-MQ_78ssZUt_qpwavhORajJvMiqzCt99+ooNQ@mail.gmail.com \
    --to=cbbrowne@gmail.com \
    --cc=tuhs@tuhs.org \
    --cc=wkt@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).