develooper Front page | perl.perl5.porters | Postings from October 2021

Re: review of perlexperiment, 2021-10

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
October 6, 2021 20:24
Subject:
Re: review of perlexperiment, 2021-10
Message ID:
CAHhgV8j_AtP=pf1OEdDkyZCEWd2S8UXZS2hzM3QEWT5HLz0Ffg@mail.gmail.com
On Sun, Oct 3, 2021 at 11:52 PM Tomasz Konojacki <me@xenu.pl> wrote:

> On Sun, 03 Oct 2021 16:41:37 -0400
> "Ricardo Signes" <perl.p5p@rjbs.manxome.org> wrote:
>
> > *smartmatch* — We have resisted removing this failure for years, as we
> want to replace it with something else.  My take:  we should just rip this
> out and later, *maybe*, put something else in. #13173 <
> https://github.com/Perl/perl5/issues/13173>
>
> Back in 2017 we tried replacing smartmatch with "dumbmatch" and in
> result we made everyone angry and broke half of CPAN:
>
> http://blogs.perl.org/users/leon_timmermans/2017/12/smartmatch-in-5277.html
> https://www.nntp.perl.org/group/perl.perl5.porters/2017/08/msg245769.html
> https://github.com/Perl/perl5/issues/16310
> https://www.nntp.perl.org/group/perl.perl5.porters/2017/12/msg248507.html
>
> I don't want that to happen again.
>
> Smartmatch is widely used because of two reasons. First of all, it
> solves an important problem: it provides "switch" and "in" operators.
> Of course, it does that in a completely insane way, but currently there
> are no (core) alternatives to it.
>
> The other reason is that we have completely failed to communicate that
> we don't want our users to use smartmatch. Until 5.18 it didn't warn at
> all, now it gives an "experimental" warning which is meaningless. Do
> signatures and smartmatch have the same status? Absolutely not. Yet
> that's what our documentation and warnings say.
>

I agree. I don't really think we can drop it now but that doesn't mean this
isn't actionable. I think it would be very useful to have a CPAN module
that's more-or-less a drop-in replacement. For given/when that's already
quite possible, for the smartmatch operator itself that would require
custom infix operators to land first.


> If we want to remove smartmatch, we need to properly deprecate it and
> provide a replacement for it. BTW, I believe LeoNerd is working on the
> latter.
>

Yeah, that's the more-future oriented approach. I suspect it's best to do
both.


> Speaking of deprecating things, the dumbmatch fiasco has showed that our
> two stable releases deprecation cycle is way too short. When the users
> of LTS distributions upgrade, they skip multiple Perl releases, so from
> their POV features disappear without any warnings! This worked OK for
> unimportant stuff that no one cared about, but I think something like
> smartmatch will need a longer deprecation period.
>

Yeah, having a fixed time period seems suboptimal. IME different situations
ask for different periods of time.

Leon

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About