Deutsch   English   Français   Italiano  
<vhkev7$29sc$1@dont-email.me>

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

Path: ...!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Command Languages Versus Programming Languages
Date: Wed, 20 Nov 2024 11:51:11 +0100
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <vhkev7$29sc$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <87edbtz43p.fsf@tudado.org>
 <0d2cnVzOmbD6f4z7nZ2dnZfqnPudnZ2d@brightview.co.uk>
 <uusur7$2hm6p$1@dont-email.me> <vdf096$2c9hb$8@dont-email.me>
 <87a5fdj7f2.fsf@doppelsaurus.mobileactivedefense.com>
 <ve83q2$33dfe$1@dont-email.me> <vgsbrv$sko5$1@dont-email.me>
 <vgtslt$16754$1@dont-email.me> <86frnmmxp7.fsf@red.stonehenge.com>
 <vhk65t$o5i$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 20 Nov 2024 11:51:20 +0100 (CET)
Injection-Info: dont-email.me; posting-host="989e2dc1ebe8052ec6f7beceade503c1";
	logging-data="75660"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+9fLqYsAAuQbY5zsNl/wlt"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
Cancel-Lock: sha1:n+/Etx9b3HHqHwTyUMk0ZuBFkHc=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <vhk65t$o5i$1@dont-email.me>
Bytes: 3297

On 20.11.2024 09:21, Muttley@DastartdlyHQ.org wrote:
> On Tue, 19 Nov 2024 18:43:48 -0800
> merlyn@stonehenge.com (Randal L. Schwartz) boring babbled:
>>
>> I'm often reminded of this as I've been coding very little in Perl these
>> days, and a lot more in languages like Dart, where the regex feels like
>> a clumsy bolt-on rather than a proper first-class citizen.
> 
> Regex itself is clumsy beyond simple search and replace patterns. A lot of
> stuff I've seen done in regex would have better done procedurally at the
> expense of slightly more code but a LOT more readability. Also given its
> effectively a compact language with its own grammar and syntax IMO it should
> not be the core part of any language as it can lead to a syntatic mess, which 
> is what often happens with Perl.

I wouldn't look at it that way. I've seen Regexps as part of languages
usually in well defined syntactical contexts. For example, like strings
are enclosed in "...", Regexps could be seen within /.../ delimiters.
GNU Awk (in recent versions) went towards first class "strongly typed"
Regexps which are then denoted by the @/.../ syntax.

I'm curious what you mean by Regexps presented in a "procedural" form.
Can you give some examples?

Personally I'm fine with the typical lexical meta-symbols in Regexps
which resembles the FSA and allows a simple transformation forth/back.

In practice, given that a Regexp conforms to a FSA, any Regexp can be
precompiled and used multiple times. The thing I had used in Java - it
was a library from Apache, IIRC, not the bulky thing that got included
later - was easily usable; create a Regexp object by a RE expression,
then operate on that same object. (Since there's still typical Regexp
syntax involved I suppose that is not what you meant by "procedural"?)

Janis