Nп/п : 77 из 100
 От   : Janis Papanagnou                    2:5075/128        18 сен 23 12:05:29
 К    : Muttley                                               18 сен 23 13:07:03
 Тема : Re: [ANN] ksh 93u+m/1.0.7
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 1@dont-email.me> dba2f1b5
@REPLY: 1@dont-email.me> 1e376ca7
@REPLYADDR Janis Papanagnou
<janis_papanagnou+ng@hotmail.com>
@REPLYTO 2:5075/128 Janis Papanagnou
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 1@dont-email.me>
@RFC-References: <kmj8hhFq8tqU1@mid.individual.net>
1@dont-email.me> 1@dont-email.me> 1@dont-email.me>
1@dont-email.me> 1@dont-email.me>
@TZUTC: 0200
@PID: Mozilla/5.0 (X11; Linux x86_64; rv:45.0)
Gecko/20100101 Thunderbird/45.8.0
@TID: FIDOGATE-5.12-ge4e8b94
On 17.09.2023 17:14, Muttley@dastardlyhq.com wrote:
> On Sat, 16 Sep 2023 23:46:04 +0200
> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
>> On 16.09.2023 10:58, Muttley@dastardlyhq.com wrote:
>>> On Fri, 15 Sep 2023 17:46:39 +0200
>>
>> Not perfectly sure I understand the "a substitute interpreted language"
>> here correctly. For sure a shell is (and always was; since Bourne) an
>> interpreted language. (And David Korn certainly, and correctly, named
>> ksh as what it was intended, a "Command and Programming Language".)

> A substitute for interpreted languages such as perl or python. Ie easy to
> write with a lot of functionality but slow as hell. [...]

Okay, I see where you`re coming from. A few comments...
The argument should probably be the other way round; perl and python
(for reasons we may leave alone for the moment) are [maybe] meant as
substitute for shell (where shells were here earlier as inherent part
of the Unixes).
Speed is indeed an issue with shells, though mind; bash is faster than
old Bourne sh (because of built-in functions that avoid costly external
tools/processes), and that Kornshell is a lot faster then bash (as one
of its central runtime optimization design criteria).

>>
>> (This appears to me to be a very limited application view.) - Are you
>> saying here that already in 1988 (or 1993 ?) Korn (et al.) provided
>> extensions to Bourne sh that were unnecessary? - You think a shell is
>> (and should be) just a command line processor (like MS cmd, or so)?
>> Even Bourne sh had while/for/case/if/... and signal traps.

> Yes it does, and its as ugly and hacky as fuck with idiotic syntactic
> quirks just like most shells.

I basically agree on that. Though the control constructs frame of the
sh-family (the part that was heavily influenced by the [probably most
formal] Algol[68] language) is still an outstanding clean concept!
It`s amazing that in Unix they invented such a language base for stuff
that was formerly handled by simple "command processors".
The ugly stuff, all that cryptic syntax parts, is indeed a "challenge"
for the programmer. Note here, though, that even that ugly part of the
shells` syntax has been made to some degree coherent by the Kornshell
designers (and some made their way into the POSIX sh and other shells).

> No sensible dev uses shell beyond kicking
> something off and maybe simply monitoring. Sysops however whom mostly can`t
> code well to save their lives seem to think programming in shell is normal
> because often thats all they know.

(These opinions, prejudices, and generalizations can`t be sensibly
commented on; I abstain. It certainly doesn`t [generally] match with
the various folks that are doing such tasks hereabouts that I`ve seen.)


>> It`s really hard to understand (from your statements) your view what
>> you think a shell should provide and what it shouldn`t. Some examples
>> would help.

> Sub shell, co processes, process substitution, lists, idiotic numeric
> syntax with (( )) everywhere (not to be confused with () or [[]] !) and
 > make sure you use your whitespace correctly because [hacky
historical reasons].

This is correct. To pick out one prominent example from your list...

Numeric processing. You wouldn`t do math, say, algebra with matrix
calculations in shell. But you have to handle numbers and numeric
expressions. That`s why (besides the clumsy `let`) the $((...)) has
been introduced in shell to write readable math expressions inside
the parenthesis and use its value. The introduction of ((...)) is
a [syntactically] straightforward ksh extension to use an arithmetic
expression as command to control the program flow in the Algol-frame
with a C/C++ boolean logic of arithmetic types.

Similar with $(...), replacing the old Bourne-sh `...`. It`s been
introduced not only to fix inherent problems with nesting and the
optical confusion with single quotes and whatnot. The syntax is also
coherent with the (...) expression. Both forms create sub-processes
(conceptually; may be optimized internally to not spawn a process),
one expands the value for use, the other just runs it.

So, yes, historic reasons lead to an evolution of shells that lead
to what we have now. And any language that is designed from scratch
for specific (other) purposes could be defined with cleaner syntax.
Though given the syntax of some newer language [versions], say C++,
current shell versions are not too bad for the areas where we use
them. (But see also my "beginners" caveat in another post here.)

> [...]
>> suited for the tasks I typically do with shell.

> So basically you know essentially squat about real programming yet you`re

(Don`t understand what "squat about real programming" is supposed to
mean.)

> advocating that shell is great for dev. Got it. Reminds me of people who

(I haven`t mentioned "dev" anywhere.)

> only know BASIC and wonder why any other language would ever be needed.

Well, I cannot speak about "other people" (as you seem to be able,
as above, here again).

I can only speak for myself (if that`s what helps you understanding
the area better); I started using shells from the Bourne family on
a regular basis around 1990. At that time I could fluently program
software solutions in more than half a dozen high-level programming
languages from that time (plus a couple assembler). In the following
decades a couple more languages filled my proficiency list. There was
never a reason to switch from shell (for the tasks suited for shells)
to other languages; also later when (e.g.) perl got more mature and I
used it for (a few) professional tasks [in environments where it was
possible to use] where it was sensible to use it - it was unnecessary.


>>> which leads shell authors to bung in features no sane
>>> person in their right mind would ever need, never mind use.
>>
>> Before diving into the details it would be good to know whether you
>> are criticizing Martijn`s "ksh93 u+m" fixes, or AT&T`s ksh93 or ksh88
>> and POSIX sh.

> The list posted a few days ago.

For the second time you didn`t answer that question (which was not
about the list). - From this post I infer that you opinion is to
not use shell for (which?) tasks. That perl and python are "better".

That`s not much substance. - Good luck, anyway.

Janis

--- Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
 * Origin: A noiseless patient Spider (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх