Deutsch   English   Français   Italiano  
<20241222131805.854@kylheku.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Kaz Kylheku <643-408-1753@kylheku.com>
Newsgroups: comp.unix.shell
Subject: Re: sed... (Was: a sed question)
Date: Sun, 22 Dec 2024 21:22:18 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <20241222131805.854@kylheku.com>
References: <874j304vv3.fsf@example.com> <vk3orv$1ut71$1@news.xmission.com>
 <lsmfo5Ffor3U1@mid.individual.net> <20241220184059.820@kylheku.com>
 <vk5d3b$1vn8e$1@news.xmission.com> <20241220195517.951@kylheku.com>
 <slrnvmedpg.26aoh.lars@cleo.beagle-ears.com>
Injection-Date: Sun, 22 Dec 2024 22:22:18 +0100 (CET)
Injection-Info: dont-email.me; posting-host="ccd8ace10f73d1976dbd98bdbf28dd7f";
	logging-data="843345"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19bJtvuOYObEuLVUdoImwykeg6r9jI2Bx8="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:sZc+tnPoC0i889RIzFL5W8KpAm8=
Bytes: 2480

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/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca