Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: the splits
On 2024-05-22 19:31, Mark J. Reed wrote:
The shell is fundamentally an interpreter; stuff written in shell
can't possibly be as fast as the code that is interpreting it. In
general, native tools are going to be more efficient.
...
As I see it, the shell is best utilized as commander and coordinator
rather than actually doing the hands-on nitty-gritty work; that's
better delegated to more efficient (and usually more specialized)
tools. The shell can absolutely do it, but it won't be the best
application of the available resources.
Makes sense. I understand that the more time spent interpreting (vs.
spent in compiled code), the slower. OTOH there's Lawrence's 'weakest
tool' rule. Just grabbing a subscript in zsh wouldn't be expected to
take very long. Dunno, I'd have to be able to look under the hood to
really see which attitude prevails in any given situation. Besides, in
my original post, speed is nearly irrelevant, it's an error msg that I
just want to look pretty. Mind ... getting rid of the 'grep', as you
first showed, really did make a noticeable difference. What I was
looking for was the most 'direct' -- really the most legible --
solution. I value clarity above all. Nice tho to be able to discuss
elegance and fine tuning, vs. getting something to work at all -- which
is more normal for me!
Messages sorted by:
Reverse Date,
Date,
Thread,
Author