Sujet : Re: sed... (Was: a sed question)
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.unix.shellDate : 22. Dec 2024, 22:22:18
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20241222131805.854@kylheku.com>
References : 1 2 3 4 5 6 7
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-12-21, Lars Poulsen <
lars@cleo.beagle-ears.com> wrote:
In article <20241220184059.820@kylheku.com>,
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
The goal of writing in sed is not to solve the problem, and to
communicate with
future users of the program so that they can adapt it to changing needs; the
goal is to puzzle out what it takes to solve it in Sed, and to show: "Hey,
look, I did this in Sed! Isn't it amazing? (And, by extension, aren't I?)"
>
Just like APL.
- "can you figure out what this one-line program does?"
- "can you think of a way to do this in fewer characters?"
It's not quite so easy to casually dismiss APL, because if you look past
the reduction in character syntax, it has a powerful array processing
paradigm that made it unique at the time of its inception. APL programs
are actually short in the number of tokens and operations specified, not
just character count.
Sed is more like BrainF##### in just making things stupidly harder;
it's not a notation for something powerful under the hood.
A sed program won't necessarily be shorter than an Awk one. For instance
certainly not if it has to implement integer addition using regexps on
strings, where the Awk program just does a + b.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca