Thursday, April 14, 2016

Re: RFE: support POSIX standard and developing RE's

On 14.04.16 14:40, Christian Brabandt wrote:
> Am 2016-04-14 12:14, schrieb Erik Christiansen:
> >So many unix utilities support POSIX "Modern" EREs, that it is the best
> >standard to conform to. There's then only one regex dialect to learn.
> >(Queue horn fanfare and singing angels)
>
> And that is an argument for what, considering that vi comes from a time,
> where BRE where the default RE dialect?

Consistent regexes across unix utilities. Perhaps I was not sufficiently
explicit in that regard? I note the deep attachment to obsolete BREs
expressed above, but the rest of the world has moved on to modern EREs.

O'Reilly's "Mastering Regular Expressions" mentions that "POSIX
standardized the workings of over 70 programs, including traditional
regex-wielding tools such as awk, ed, egrep, expr, grep, and sed."
(And mutt, lex, ...)

$ man 7 regex

> >>The thing is, Vims RE support atoms, that other RE engines do not
> >>support. Think about e.g. \_. \< \%l \%'m
> >
> >Never heard of 'em, and don't waste wet RAM on dialect tricks which
> >won't work in grep and awk, and ... , as it just leads to frustration.
>
> See, if you really want to discuss seriously, you should try to be
> polite and do not troll.

Please accept my apologies for expressing a personal preference. I
didn't realise that you would not permit that.

> Then you should know, that just because you don't need a feature, does
> not mean, we should not implement it.

Excuse me, but now you are fantasising, I submit. How can you possibly
extrapolate that from one personal preference. (Admittedly expressed
without your prior permission)

> And perhaps you should spend a little time in :h pattern.txt and read
> what those patterns are for, before you come to the conclusion that
> this is not needed.

Where have I said that it is not needed? My consistent cross-tool use of
posix idiom means that I get along fine without it, but I have made no
suggestions about anyone else's usage. My migration proposal was careful
to avoid inconvenience to adherents of obsolete regex dialects.

> >
> >>That makes adding another RE engine hard.
> >
> >If so, it's only hard once, not every day, as with cross-tool regex
> >chaos.
>
> Look at all the bugs, that were needed to be fixed when integrating
> the second engine, before you say this please.

Hmmm ... that sounds slightly irritable. Even if several bugfixes follow
the initial porting of a posix regex engine, it is still a one-time
cycle, rather than endless years of user inconvenience. (I'm retired,
after several decades of software development, and do tend to forget the
pain of bugfixes after the product is in the field. But in embedded
systems we did an awful lot of testing, and few escaped to the wild.)

> >It is Unix which "is the IDE", not any single application. The
> >"Eclectic Rubbish Lister" has wandered off into insular dialect land.
> >Unfortunately Vim has committed the same folly. Now it is time to pay
> >the piper.
> >
> >Where to from here, then? To bring order, can we not _finally_ adopt
> >POSIX EREs, adding the parochial \_. \< \%l \%'m stuff as
> >extensions?
>
> Sure. Codes speakes louder than words. And someone has to make the
> effort. And the fact that this has not been done could mean, that
> nobody really cared about POSIX ERE compatibility.

Noted. It wasn't considered important in 2013 either, when the topic
last had a significant airing that I recall.

> >I did compile Vim with a POSIX ERE regex engine many years ago. It
> >worked fine, but the help broke, there wasn't time to fix that, and I
> >only used it for a couple of months.
>
>
> I really really doubt this was ever possible. Please tell us exactly
> what version this was and what POSIX ERE engine you used. The current
> codebase uses a lot of the vim specific regex functions, so I would be
> surprised, that this actually compiled.

If we doubt each other's truthfulness, then there is little to discuss.
Perhaps you have had a hard day, and are not thinking clearly. This
post:

https://groups.google.com/forum/#!msg/vim_use/s6cUfZs7SYo/w1_9QOXONpQJ

reminds me that some function renaming and parameter wrangly through
wrappers was used to hook up to the needed functions. A little makefile
tweak would have been in order. The result gave me posix regexes in
searches, which was what I sought. Help broke, and i didn't test
scripting. (If I need scripted regexes, I'll use awk or sed, thankyou.)

It was around a decade ago. There may be older related posts in the
archive.

>
> >So substituting an improved RE engine is not difficult. Extending
> >that to add vimishness might take a little longer, but it has been
> >done in the existing engine. It would be wonderful if that could be
> >done in my lifetime.
> >
> >Personally, I'd settle for a compile option which simply substituted
> >POSIX EREs, without breaking the help. The vimishness could then go
> >hang. Would that also suffice for the others advocating POSIX ?
> >
> >A subsequent step might then be to add vimishness, and make the new
> >engine mainstream? VEREs anyone?
>
> Well, nobody prevents you from contributing ;)

That is true. And in retirement, there should be time enough, in theory.

Erik

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment