Sujet : Re: Command Languages Versus Programming Languages
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscDate : 29. Mar 2024, 22:06:58
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uu7ahh$ghfn$5@dont-email.me>
References : 1 2
User-Agent : Pan/0.155 (Kherson; fc5a80b8)
On Fri, 29 Mar 2024 08:09:46 -0300, Johanne Fairchild wrote:
Consider looking at a shell language like a domain-specific programming
language. A shell is a programming language made specifically for
running programs. ... (Of course, the idea evolves and you want to
glue programs, do variable substitution et cetera.)
That’s the thing. The design for a “language made specifically for running
programs” always seems to start with the assumption that what the user
types is to be passed as literal text, unless special markers are present
to indicate that they want to “glue programs, do variable substitution et
cetera”. Notice your use of the term “variable substitution”, which is
characteristic of a shell language: in a programming language, you don’t
call it “substitution”, you call it “evaluation”.
A scripting language is a programming language made for a hypothetical
machine, not too different from a programming language made for a real
machine, one made of hardware.
In our CS classes we learned to think about “abstract machines”, and
forget the distinction between “software” and “hardware”. Instead, we
build layers of abstract machines, one on top of the other, getting more
and more specialized towards the particular class of problems we want to
solve at any particular time.
Command languages are just another such “abstract machine”, and the
scripts we write in them are another layer on top.
The layering only stops when you get to a GUI; they can’t be used to build
any further “machines” on top.
You seem to find trouble with using a programming language in a REPL.
I find REPLs annoying and inconvenient. If I want to do “scratchpad”
programming, I do it in a Jupyter notebook.