Sujet : Re: Command Languages Versus Programming Languages
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shellDate : 29. Mar 2024, 12:36:34
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uu6943$91br$1@dont-email.me>
References : 1 2
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 29.03.2024 12:09, Johanne Fairchild wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
At one time, we distinguished between “scripting” languages and
“programming” languages. [...] But there is one distinction that I
think is still relevant, and that is the one between shell/command
languages and programming languages.
[...]
Consider looking at a shell language like a domain-specific programming
language. A shell is a programming language made specifically for
running programs. When you write a shell line, you're specifying the
arguments of execve(2). In other words, a shell is a programming
language made to prepare the memory to be consumed by the system in a
specific way---execve(2). (Of course, the idea evolves and you want to
glue programs, do variable substitution et cetera.)
I like the characterization as domain-specific programming
languages.
The "glue" is also control constructs (if/case/while/for/...),
which are typical characteristics of programming languages.
It's not only 'exec'. You can also view the exec'ed commands
as the functions from a "library" (/usr/bin, etc.), called
from the shell's control logic.
That's another view that may be better suited when inspecting
the modern more powerful shells than the legacy ones from the
1970's (which of course also had control constructs already).
Janis