:: Re: [DNG] Harbour programming langu…
Page principale
Supprimer ce message
Répondre à ce message
Auteur: Steve Litt
Date:  
À: dng
Sujet: Re: [DNG] Harbour programming language
Adrian Zaugg said on Fri, 20 Oct 2023 10:23:33 +0200

>Hi Steve
>
>In der Nachricht vom Saturday, 14 October 2023 07:22:05 CEST schrieb
>Steve Litt:
>> What I'm discovering is that Harbour *might* make a pretty good
>> substitute for shellscripts, especially shellscripts that loop a lot,
>> because looping in shellscripts is *incredibly* slow. I'll keep you
>> in
>
>If you think of this as a replacement for system shell scripts, I
>would strongly oppose: Every decent sysadmin can understand shell
>scripts and correct them or write its own.


Oh my gosh of course it shouldn't replace shellscripts from distros. I
now realize I should have worded it differently. If they replaced
shellscripts with Harbour I'd be screaming as loudly as I did when they
tried to ram systemd down our throats.

What *I* was talking about is the *option*, on a script by script
basis, for users like me to create shellscript type entities using
Harbour. But of course I expressed it ambiguously.


>We use the shell every day
>and do constantly repeat and learn about. It's a natural fit.


Yes it is a natural fit.

>Thus
>replacing shell scripts in the system with something exotic I consider
>a bad idea.


I agree.

>
>If you menat it for ones personal little hacks or projects, thank you
>for pointing it out.


The preceding sentence expresses exactly what I was trying to point
out. Thanks for clarifying this.
>
>Regards, Adrian.
>
>P.S.:
>- Loops in shell scripts are not always necessary, sed, grep and the
>other shell friends can often be used without a loop.


Yes. I often use stuff like this. But, for instance, sed is a little
like SQL: Capable of creating a 1 liner that takes a week to
understand. I use AWK for a lot of stuff. The real beauty of grep is
you can get rid of the vast majority of don't-care lines before doing
expensive stuff like sort.

>
>- Loops do get slow in shell scripts, when you instantiate a command
>in each turn. If you use bash internals inside the loop (or what ever
>shell you use) it is as fast as any other loop elsewhere.


Are you telling me that [ is faster than test ?

Thanks,

SteveT

Steve Litt

Autumn 2023 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21