Mailing List Archive

1 2 3  View All
Re: on changing perl's behavior [ In reply to ]
On Tue, Mar 30, 2021 at 09:54:48AM +0200, Christian Walde wrote:
> On Tue, 30 Mar 2021 05:07:37 +0200, Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote:
> > This one I think I can only state as a trade-off per se: Spending time on maintaining long-discouraged >behaviors is good only to the extent that they can't be deprecated and removed instead. How do we know >whether we can deprecate and remove some behavior? Well, that's largely a function of all of the above.
> Have more reading and thinking to do, but:
>
> As far as i am informed this one is a red herring.
>
> To my knowledge both DaveM and LeoNerd have opined that deprecating old behaviors gains little to none for the code Perl actually has at the moment.

I'm neither of the above but yes, generally, existing behaviour doesn't
"get in the way". In that

* most things that folks are interested in (and are achievable) are better
syntax for existing fundamental operations
* (obscure) existing runtime behaviour rarely gets in the way of this

(So I think even for try/catch which is more than just compile time, there
isn't much in the existing runtime that gets in the way of implementing it -
it's mostly figuring out syntax and semantics, and then *extending* the
existing runtime to support it.)

Existing expectations for emergent behaviour *do* get in the way of
refactoring things - but these are rarely about syntax, or at least
documented syntax. It's hard to refactor things without discovering that
two (or more) subtle implementation details interact to create runtime
behaviour that wasn't documented or tested, but it turns out something
relies on it. That last part seemingly is "Hyrum's Law":

With a sufficient number of users of an API,
it does not matter what you promise in the contract:
all observable behaviors of your system
will be depended on by somebody.



Anyway, the substantive part of this message was meant to be the tale of
three punctuation variables $#, $* and $[, and how removing them had
different implications. All from memory:

$# The output format for printed numbers. This variable is a
half-hearted attempt to emulate awk's OFMT variable. There are
times, however, when awk and Perl have differing notions of
what counts as numeric. The initial value is "%.ng", where n
is the value of the macro DBL_DIG from your system's float.h.
This is different from awk's default OFMT setting of "%.6g", so
you need to set $# explicitly to get awk's value. (Mnemonic: #
is the number sign.)


So the problem with $# is that (like all the rest) it's a global, and its
value can be changed at runtime. (Yes, technically not $[ since 5.000)

And this ability to be changed at runtime interferes with caching the string
values of scalars with floating point values - the caching is part of the
scalar, whereas the "correct" formatting is for the current scope.
(Strictly dynamic scope, but making it lexical scope wouldn't have changed
this).

So it was deprecated, and eventually removed, and all was good. I think
that this reduced a bit of complexity in just one place in sv.c

Oh pants, except for numeric locales, which have the same basic problem -
your formatting of 3.14 might be "3,14" in some places (or some calls)
depending on your locale.

So in the end, this wasn't a win.


$* Set to a non-zero integer value to do multi-line matching
within a string, 0 (or undefined) to tell Perl that it can
assume that strings contain a single line, for the purpose of
optimizing pattern matches. Pattern matches on strings con?
taining multiple newlines can produce confusing results when $*
is 0 or undefined. Default is undefined. (Mnemonic: * matches
multiple things.) This variable influences the interpretation
of only "^" and "$". A literal newline can be searched for even
when "$* == 0".

Use of $* is deprecated in modern Perl, supplanted by the "/s"
and "/m" modifiers on pattern matching.

Assigning a non-numerical value to $* triggers a warning (and
makes $* act if "$* == 0"), while assigning a numerical value


As featured in Ricardo's example.

Again, dynamic, needs to be checked everywhere at runtime - qr// compiles
regexps that can be passed to different scopes, hence unlike the /s and /m
modifiers one can't just attach it to the compiled representation and be
done.

So removing this remove several small instances of code.


$[ The index of the first element in an array, and of the first
character in a substring. Default is 0, but you could theoret?
ically set it to 1 to make Perl behave more like awk (or For?
tran) when subscripting and when evaluating the index() and
substr() functions. (Mnemonic: [ begins subscripts.)

As of release 5 of Perl, assignment to $[ is treated as a com?
piler directive, and cannot influence the behavior of any other
file. (That's why you can only assign compile-time constants
to it.) Its use is highly discouraged.

Note that, unlike other compile-time directives (such as
strict), assignment to $[ can be seen from outer lexical scopes
in the same file. However, you can use local() on it to
strictly bind its value to a lexical block.


OK, not strictly dynamic, but that's not the problem.

*This* one hides a bunch of "fun". Given that substring and array offsets
can be expressed as negative values, how does "1" interact with that?

That was actually reasonably well defined. The real fun was *implementing*
it. The naïve approach is something like `$len + 1 + abs($offset)`.

Problem was that's fine in Perl where values are floating point*, but in C
this needs to be done with integers. Which are probably the largest integer
on the system, and so "largest value plus one" can't be represented.
Hence (IIRC) there was a security bug about this, and then a lot of care
was taken by someone (sorry, I forget whom) to re-write the implementation
to avoid overflow in the corner cases.

And even after this and a lot of staring at it by several others it was
still "no obvious bugs" and not "obviously no bugs"

So getting rid of $[ meant that all this code could go.


So the point that I'd like to make is that there are *some* things that
might be removed to simplify the internals and reduce the support burden,
but *most* existing things don't get in the way, at least at runtime.

Nicholas Clark

* or fake it like they are
Re: on changing perl's behavior [ In reply to ]
On Wed, 07 Apr 2021 15:26:55 +0200, Nicholas Clark <nick@ccl4.org> wrote:

> So the point that I'd like to make is that there are *some* things that
> might be removed to simplify the internals and reduce the support burden,
> but *most* existing things don't get in the way, at least at runtime.

Thanks for adding more detail. I really appreciate that effort to provide tangible evidence for this. :)

A small addendum:

I think it's fine to change the defaults in these cases:

1. when the behavior is a security risk
2. when the behavior is outright broken and subverts expectations and optimally also documentation
3. when actually finding examples of anybody using the behavior is nearly impossible

I think your examples all fall under 3.?

Outside of that, when a huge win can be demonstrated, stuff should be removed, but then i'd prefer it be done by way of deprecating that specific dialect.

--
With regards,
Christian Walde
Re: on changing perl's behavior [ In reply to ]
Op 07-04-2021 om 02:23 schreef Yuki Kimoto:
> rjbs
>
> ----------
> On Sun, Apr 4, 2021, at 7:58 PM, Yuki Kimoto wrote:
>> Personally, why not use the following syntax
>>
>> use v5.26;
>> use v5.28;
>> use v5.30;
>> use v5.32;
>>
>> 1. that don't include warnings program.
>>
>> 2. The features introduced in the minor version are hard to
>> understand. It feels like a feature that early adopters try.
>
> I don't understand what you mean, especially by point #2.
> ------------
>
> Suppose I am a beginner.
>
> I can't understand the difference between "use v5.26" and "use v5.32".
>
> This is because the unit for minor releases is too small.
>
> If it is "use v7;", I can understand the features by reading only one
> page that explains it.


That is my feeling too. "use v7" will be the way to get modern Perl. It
should be and will be a major step in evolving the language and will be
the standard for new Perl code world wide. Using minor versions may take
off, or it may not after that, but that is actually not that important.
As long as v7, v8, etc define a well thought out step forward, that is
probably what people will use, and that will be a boon to Perl.


M4
Re: on changing perl's behavior [ In reply to ]
> On Apr 7, 2021, at 10:31 AM, Christian Walde <walde.christian@gmail.com> wrote:
>
> On Wed, 07 Apr 2021 15:26:55 +0200, Nicholas Clark <nick@ccl4.org> wrote:
>
>> So the point that I'd like to make is that there are *some* things that
>> might be removed to simplify the internals and reduce the support burden,
>> but *most* existing things don't get in the way, at least at runtime.
>
> Thanks for adding more detail. I really appreciate that effort to provide tangible evidence for this. :)
>
> A small addendum:
>
> I think it's fine to change the defaults in these cases:
>
> 1. when the behavior is a security risk
> 2. when the behavior is outright broken and subverts expectations and optimally also documentation
> 3. when actually finding examples of anybody using the behavior is nearly impossible
>
> I think your examples all fall under 3.?
>
> Outside of that, when a huge win can be demonstrated, stuff should be removed, but then i'd prefer it be done by way of deprecating that specific dialect.


I would argue (though it's hard to search for "format" in the issues list) that being able to close 50+ cases would be nice if we could just say: "Formats are removed. this issue is now irrelevant."

For me all of that would fall under #2.

Todd
Re: on changing perl's behavior [ In reply to ]
On Thu, Apr 8, 2021, at 5:18 PM, Todd Rinaldo wrote:
>> Outside of that, when a huge win can be demonstrated, stuff should be removed, but then i'd prefer it be done by way of deprecating that specific dialect.
>
> I would argue (though it's hard to search for "format" in the issues list) that being able to close 50+ cases would be nice if we could just say: "Formats are removed. this issue is now irrelevant."

I think that's true, strictly speaking, but: of the people who use formats, how many would be impacted, and how, if we removed formats? Well, 100% of them would be impacted, and the impact would be "I had to rewrite some code" which (given how formats work) would probably be kind of a pain in the butt. Sometimes a big one, sometimes pretty tiny.

On the other hand, the benefit of closing tickets that we were ignoring *anyway* is pretty darn low.

Christian's #2, changing defaults when they confound users, should be weighed against users confounded. I think we'd find that in general, new users are not reaching for formats. If users say "I'm using formats, and this part was confusing," and we say, "okay, we have ripped out formats," I don't think anybody's going to thank us for that.

--
rjbs
Re: on changing perl's behavior [ In reply to ]
On 4/8/21 9:23 PM, Ricardo Signes wrote:
> On Thu, Apr 8, 2021, at 5:18 PM, Todd Rinaldo wrote:
>>> Outside of that, when a huge win can be demonstrated, stuff should be
>>> removed, but then i'd prefer it be done by way of deprecating that
>>> specific dialect.
>>
>> I would argue (though it's hard to search for "format" in the issues
>> list) that being able to close 50+ cases would be nice if we could
>> just say: "Formats are removed. this issue is now irrelevant."
>
> I think that's true, strictly speaking, but:  of the people who use
> formats, how many would be impacted, and how, if we removed formats?
> Well, 100% of them would be impacted, and the impact would be "I had to
> rewrite some code" which (given how formats work) would probably be kind
> of a pain in the butt.  Sometimes a big one, sometimes pretty tiny.
>
> On the other hand, the benefit of closing tickets that we were ignoring
> /anyway/ is pretty darn low.

Might you have a sampling of such tickets? Please don't read into the
request, I am more curious than anything.

Thank you,
Brett

>
> Christian's #2, changing defaults when they confound users, should be
> weighed against users confounded.  I think we'd find that in general,
> new users are not reaching for formats.  If users say "I'm using
> formats, and this part was confusing," and we say, "okay, we have ripped
> out formats," I don't think anybody's going to thank us for that.
>
> --
> rjbs
Re: on changing perl's behavior [ In reply to ]
On Friday, 9 April 2021, 04:24:34 CEST, Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote:

On Thu, Apr 8, 2021, at 5:18 PM, Todd Rinaldo wrote:


Outside of that, when a huge win can be demonstrated, stuff should be removed, but then i'd prefer it be done by way of deprecating that specific dialect.


Christian's #2, changing defaults when they confound users, should be weighed against users confounded.  I think we'd find that in general, new users are not reaching for formats.  If users say "I'm using formats, and this part was confusing," and we say, "okay, we have ripped out formats," I don't think anybody's going to thank us for that.

Late to the party, not a core dev, and probably shouldn't wade into the lion's den, but I'd like to offer my (obviously biased) thoughts.

I have read and written on the subject of emigration for many years and I having been thinking that those issues are relevant to Perl. Why do people leave a country? There are push factors (war, famine, lack of jobs, discrimination, etc.) and pull factors (climate, jobs, culture, etc.). When push factors are the primary motivation (think "Somalia"), refugees will flee to just about any place that will take them. When pull factors are the primary motivation, people want to go there. The US and France, for example, both have plenty of (very different) pull factors and lots of people want to move to those countries.
It's even stronger for programming languages because there's not mcuh barrier to entry to other languages.
Perl has a lot of push factors (fewer jobs, old-fashioned language, frequently cryptic syntax), but what are the pull factors? I don't mean the pull factors for us. We're not the target audience here. I mean "pull factors for new developers." It's not the CPAN. It's not unicode support. PCRE is nice by most regexes I encounter in the wild aren't much more complicated than /ab(c*)de/. It's a nice glue language, but DevOps chose Ruby instead (why? push factors).

I can name push factors for Perl all day long, but pull factors? And pull factors that overcome the push factors? And make Perl more enticing than alternative languages? I could start listing push/pull factors for Python, but I don't want to start the day silently weeping into my coffee.

So, some points that I think are important:


- If we break back-compat silently, people won't blame the sysadmin who upgraded without checking. They'll blame Perl. That's a new push factor.

- I don't hear other devs saying I won't use Perl because of <insert unpopular feature here>. They say "I won't use Perl because it's Perl." We could use this bullet point to list many, many push factors.

- Perl will die unless we give people a reason to try it again (and I agree that new OOP isn't the solution, but I contend that it's part of it). We need lots of pull factors.


Saying we should just keep Perl as "Perl", maybe remove some cruft is ignoring pull factors. It's saying "I want to go gentle into that good night." Perl will continue it's long slide into irrelevancy and people who enjoy Perl will have to find other ways of paying the bills. Make developers sit up and say "I want that!" When I give intro Raku talks, developers sit up and say "I want that.!" They say that about numerous features. They don't say that about Perl. (That's not saying anything about whether or not Raku will be successful)
So, given the assumption that Perl's push/pull ratio is poor, I contend that only a wholesale, radical upgrade of the language is the only way to save it.

Best,Ovid
Re: on changing perl's behavior [ In reply to ]
On Fri, 09 Apr 2021 10:07:31 +0200, Ovid via perl5-porters <perl5-porters@perl.org> wrote:

> On Friday, 9 April 2021, 04:24:34 CEST, Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote:
>
> On Thu, Apr 8, 2021, at 5:18 PM, Todd Rinaldo wrote:
>>> Outside of that, when a huge win can be demonstrated, stuff should be removed, >>>but then i'd prefer it be done by way of deprecating that specific dialect.
>>
>> Christian's #2, changing defaults when they confound users, should be weighed against users >>confounded. I think we'd find that in general, new users are not reaching for formats. If users >>say "I'm using formats, and this part was confusing," and we say, "okay, we have ripped out >>formats," I don't think anybody's going to thank us for that.
>
> Late to the party, not a core dev, and probably shouldn't wade into the lion's den, but I'd like to offer my >(obviously biased) thoughts.
[...]
> So, given the assumption that Perl's push/pull ratio is poor, I contend that only a wholesale, radical upgrade >of the language is the only way to save it.

Less of a den of lions matter it's a question of what was already discussed. :)

It sounds like you're agreeing with noises made previously, to cite myself here:

"I want future Perls to be as bold as possible. I want Perl v7 to
change as much as it humanly can. I want it to be brutal, a sledge
hammer. I want it to include every possible default change we can
remotely justify. I want it to change so much as to get close to
being a new language as the major version bump indicates."

and to cite Leonerd:

We need to look at who is, and isn't, using Perl currently and
consider whether actually `use VERSION` would help us provide a
better Perl for both of these use-cases, as well as give us a
great way to build a lot of marketing and promotion around that
by pointing out that both kinds of Perl even exist.


Source for both: https://www.nntp.perl.org/group/perl.perl5.porters/2021/03/msg259585.html


--
With regards,
Christian Walde
Re: on changing perl's behavior [ In reply to ]
On Fri, 09 Apr 2021 04:23:43 +0200, Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote:

> On Thu, Apr 8, 2021, at 5:18 PM, Todd Rinaldo wrote:
>>> Outside of that, when a huge win can be demonstrated, stuff should be removed, but >>>then i'd prefer it be done by way of deprecating that specific dialect.
>>
>> I would argue (though it's hard to search for "format" in the issues list) that being able to close 50+ >>cases would be nice if we could just say: "Formats are removed. this issue is now irrelevant."
>
> I think that's true, strictly speaking, but: of the people who use formats, how many would be impacted, and how, if >we removed formats? Well, 100% of them would be impacted, and the impact would be "I had to rewrite some >code" which (given how formats work) would probably be kind of a pain in the butt. Sometimes a big one, >sometimes pretty tiny.
>
> On the other hand, the benefit of closing tickets that we were ignoring anyway is pretty darn low.
>
> Christian's #2, changing defaults when they confound users, should be weighed against users confounded. I think >we'd find that in general, new users are not reaching for formats. If users say "I'm using formats, and this part was >confusing," and we say, "okay, we have ripped out formats," I don't think anybody's going to thank us for that.

100% agree with this, and to add a little more:

My first three points were for changed defaults.

"remove behavior" is a separate concern, as removing behavior only very rarely results in fixed bugs, but usually explicitly in WONTFIX.

--
With regards,
Christian Walde
Re: on changing perl's behavior [ In reply to ]
On Thu, 08 Apr 2021 23:18:43 +0200, Todd Rinaldo <toddr@cpanel.net> wrote:

> I would argue (though it's hard to search for "format" in the issues list) that being able to close 50+ cases would be nice if we could just say: "Formats are removed. this issue is now irrelevant."

One more addendum here.

There's a way to make everyone happy.



Define `use 7;` and up as: "doesn't provide format-related things".

Define missing `use $v;` or one with $v < 7 as: "provides format-related things as they were pre-7".



That way we don't step on any toes of format users, and Leonerd can create new syntax using format-danglies in v7+.

--
With regards,
Christian Walde
Re: on changing perl's behavior [ In reply to ]
On Friday, 9 April 2021, 11:32:55 CEST, Christian Walde <walde.christian@gmail.com> wrote:

> There's a way to make everyone happy.
>
> Define `use 7;` and up as: "doesn't provide format-related things".
>
> Define missing `use $v;` or one with $v < 7 as: "provides format-related things as they were pre-7".
>
> That way we don't step on any toes of format users, and Leonerd can create new syntax using format-danglies in v7+.

I am not sure I understand. Are you suggesting that if you want the benefit of v7 and you want formats, you're out of luck? Or are you suggesting you have to learn more boilerplate by explicitly not using "v7" but writing the boilerplate to get the benefits of v7+formats? That isn't better than what we have, so I think I've misunderstood you.

Best,Ovid
-- IT consulting, training, specializing in Perl, databases, and agile developmenthttp://www.allaroundtheworld.fr/. 
Buy my book! - http://bit.ly/beginning_perl
Re: on changing perl's behavior [ In reply to ]
On Fri, 09 Apr 2021 11:51:33 +0200, Ovid <curtis_ovid_poe@yahoo.com> wrote:

> On Friday, 9 April 2021, 11:32:55 CEST, Christian Walde <walde.christian@gmail.com> wrote:
>
>> There's a way to make everyone happy.
>>
>> Define `use 7;` and up as: "doesn't provide format-related things".
>>
>> Define missing `use $v;` or one with $v < 7 as: "provides format-related things as they were pre-7".
>>
>> That way we don't step on any toes of format users, and Leonerd can create new syntax using format-danglies in v7+.
>
> I am not sure I understand. Are you suggesting that if you want the benefit of v7 and you want formats, you're out of luck? Or are you suggesting you have to learn more boilerplate by explicitly not using "v7" but writing the boilerplate to get the benefits of v7+formats? That isn't better than what we have, so I think I've misunderstood you.

As long as Perl dialects $v < 7 are still implemented in the interpreter you can do:

use 7;

sub do_format {
use 5;
format ...;
write;
}

or

sub do_format {
format ...;
write;
}

use 7;

do_format();

Only once it is decided that dialects $v < 7 be deprecated would those stop to work.

--
With regards,
Christian Walde
Re: on changing perl's behavior [ In reply to ]
On Thu, 08 Apr 2021 22:23:43 -0400
"Ricardo Signes" <perl.p5p@rjbs.manxome.org> wrote:

> On Thu, Apr 8, 2021, at 5:18 PM, Todd Rinaldo wrote:
> >> Outside of that, when a huge win can be demonstrated, stuff should
> >> be removed, but then i'd prefer it be done by way of deprecating
> >> that specific dialect.
> >
> > I would argue (though it's hard to search for "format" in the
> > issues list) that being able to close 50+ cases would be nice if we
> > could just say: "Formats are removed. this issue is now
> > irrelevant."
>
> I think that's true, strictly speaking, but: of the people who use
> formats, how many would be impacted, and how, if we removed formats?
> Well, 100% of them would be impacted, and the impact would be "I had
> to rewrite some code" which (given how formats work) would probably
> be kind of a pain in the butt. Sometimes a big one, sometimes pretty
> tiny.

In terms of eating into syntax we'd like to use for other things,
formats consume two keywords that aren't *that* interesting (`format`
and `write`), and a bunch of variables; some of which we'd quite like
to reclaim for syntax purposes.

I have a branch that provides a (default-on) feature for parsing of the
format-related variables, so that a future perl can simply

no feature 'format_vars';

to get all those back.

https://github.com/Perl/perl5/tree/leonerd/feature-format-vars

--
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/
Re: on changing perl's behavior [ In reply to ]
Op 09-04-2021 om 12:09 schreef Christian Walde:
> On Fri, 09 Apr 2021 11:51:33 +0200, Ovid <curtis_ovid_poe@yahoo.com>
> wrote:
>
>> ?? On Friday, 9 April 2021, 11:32:55 CEST, Christian Walde
>> <walde.christian@gmail.com> wrote:
>>
>>> There's a way to make everyone happy.
>>>
>>> Define `use 7;` and up as: "doesn't provide format-related things".
>>>
>>> Define missing `use $v;` or one with $v < 7 as: "provides
>>> format-related things as they were pre-7".
>>>
>>> That way we don't step on any toes of format users, and Leonerd can
>>> create new syntax using format-danglies in v7+.
>>
>> I am not sure I understand. Are you suggesting that if you want the
>> benefit of v7 and you want formats, you're out of luck? Or are you
>> suggesting you have to learn more boilerplate by explicitly not using
>> "v7" but writing the boilerplate to get the benefits of v7+formats?
>> That isn't better than what we have, so I think I've misunderstood you.
>
> As long as Perl dialects $v < 7 are still implemented in the
> interpreter you can do:
>
> ?? use 7;
>
> ?? sub do_format {
> ?????? use 5;
> ?????? format ...;
> ?????? write;
> ?? }
>
> or
>
> ?? sub do_format {
> ?????? format ...;
> ?????? write;
> ?? }
>
> ?? use 7;
>
> ?? do_format();

Or simply

?? use 7;
?? use feature 'format';

?? sub do_format {
?????? format ...;
?????? write;
?? }


> Only once it is decided that dialects $v < 7 be deprecated would those
> stop to work.


Which is decoupled if it is a feature.


HTH,

M4
Re: on changing perl's behavior [ In reply to ]
On Fri, 09 Apr 2021 15:51:02 +0200, Martijn Lievaart <m@rtij.nl> wrote:

> Op 09-04-2021 om 12:09 schreef Christian Walde:
>> On Fri, 09 Apr 2021 11:51:33 +0200, Ovid <curtis_ovid_poe@yahoo.com>
>> wrote:
>>
>>> On Friday, 9 April 2021, 11:32:55 CEST, Christian Walde
>>> <walde.christian@gmail.com> wrote:
>>>
>>>> There's a way to make everyone happy.
>>>>
>>>> Define `use 7;` and up as: "doesn't provide format-related things".
>>>>
>>>> Define missing `use $v;` or one with $v < 7 as: "provides
>>>> format-related things as they were pre-7".
>>>>
>>>> That way we don't step on any toes of format users, and Leonerd can
>>>> create new syntax using format-danglies in v7+.
>>>
>>> I am not sure I understand. Are you suggesting that if you want the
>>> benefit of v7 and you want formats, you're out of luck? Or are you
>>> suggesting you have to learn more boilerplate by explicitly not using
>>> "v7" but writing the boilerplate to get the benefits of v7+formats?
>>> That isn't better than what we have, so I think I've misunderstood you.
>>
>> As long as Perl dialects $v < 7 are still implemented in the
>> interpreter you can do:
>>
>> use 7;
>>
>> sub do_format {
>> use 5;
>> format ...;
>> write;
>> }
>>
>> or
>>
>> sub do_format {
>> format ...;
>> write;
>> }
>>
>> use 7;
>>
>> do_format();
>
> Or simply
>
> use 7;
> use feature 'format';
>
> sub do_format {
> format ...;
> write;
> }
>
>> Only once it is decided that dialects $v < 7 be deprecated would those
>> stop to work.
>
> Which is decoupled if it is a feature.

Also nice, yes. :)

Or LeoNerd's work here. https://www.nntp.perl.org/group/perl.perl5.porters/2021/04/msg259769.html

Many ways to slice this carrot. :D

--
With regards,
Christian Walde
Re: on changing perl's behavior [ In reply to ]
Everyone is talking on the assumption that Perl is declining.

The feeling I get in Japan is that Perl has been recovering little by
little since around 2018.

The loud voice on the surface of the web may not be what it really is.

2021?4?9?(?) 23:30 Christian Walde <walde.christian@gmail.com>:

> On Fri, 09 Apr 2021 15:51:02 +0200, Martijn Lievaart <m@rtij.nl> wrote:
>
> > Op 09-04-2021 om 12:09 schreef Christian Walde:
> >> On Fri, 09 Apr 2021 11:51:33 +0200, Ovid <curtis_ovid_poe@yahoo.com>
> >> wrote:
> >>
> >>> On Friday, 9 April 2021, 11:32:55 CEST, Christian Walde
> >>> <walde.christian@gmail.com> wrote:
> >>>
> >>>> There's a way to make everyone happy.
> >>>>
> >>>> Define `use 7;` and up as: "doesn't provide format-related things".
> >>>>
> >>>> Define missing `use $v;` or one with $v < 7 as: "provides
> >>>> format-related things as they were pre-7".
> >>>>
> >>>> That way we don't step on any toes of format users, and Leonerd can
> >>>> create new syntax using format-danglies in v7+.
> >>>
> >>> I am not sure I understand. Are you suggesting that if you want the
> >>> benefit of v7 and you want formats, you're out of luck? Or are you
> >>> suggesting you have to learn more boilerplate by explicitly not using
> >>> "v7" but writing the boilerplate to get the benefits of v7+formats?
> >>> That isn't better than what we have, so I think I've misunderstood you.
> >>
> >> As long as Perl dialects $v < 7 are still implemented in the
> >> interpreter you can do:
> >>
> >> use 7;
> >>
> >> sub do_format {
> >> use 5;
> >> format ...;
> >> write;
> >> }
> >>
> >> or
> >>
> >> sub do_format {
> >> format ...;
> >> write;
> >> }
> >>
> >> use 7;
> >>
> >> do_format();
> >
> > Or simply
> >
> > use 7;
> > use feature 'format';
> >
> > sub do_format {
> > format ...;
> > write;
> > }
> >
> >> Only once it is decided that dialects $v < 7 be deprecated would those
> >> stop to work.
> >
> > Which is decoupled if it is a feature.
>
> Also nice, yes. :)
>
> Or LeoNerd's work here.
> https://www.nntp.perl.org/group/perl.perl5.porters/2021/04/msg259769.html
>
> Many ways to slice this carrot. :D
>
> --
> With regards,
> Christian Walde
>
Re: on changing perl's behavior [ In reply to ]
On Sat, 27 Mar 2021 16:49:15 -0400, "Ricardo Signes"
<perl.p5p@rjbs.manxome.org> wrote:

> So I think, after saying all this, the first big question is: Is
> there a general agreement that there are kinds of changes we've made
> (or will make) to the language that we can ease into making the
> default, through some multi-step process? We may need to hash out
> individual changes' paths forward, but if there is an overwhelming
> opposition to changing these sorts of defaults *at all*, then I think
> a lot of this conversation has to be entirely reconsidered.

I already gave a +1 earlier, but I like to add

"Considering deprecation of an existing feature/function is beneficial
to a new feature/function, check if it possible to provide a clear
path that can be used to replace the old functionality."

The best way (imho) would be a clear warning/error message showing the
cause and the alternative. An imaginary example

say $foo.method ($arg);

Syntax error: You are using "." after object ?$foo?, but ?$foo? does
not support stringification. Maybe you meant to use "->"

--
H.Merijn Brand https://tux.nl Perl Monger http://amsterdam.pm.org/
using perl5.00307 .. 5.33 porting perl5 on HP-UX, AIX, and Linux
https://tux.nl/email.html http://qa.perl.org https://www.test-smoke.org
Re: on changing perl's behavior [ In reply to ]
* "H.Merijn Brand via perl5-porters" <perl5-porters@perl.org> [2021-04-12T10:39:22]
> I already gave a +1 earlier, but I like to add
>
> "Considering deprecation of an existing feature/function is beneficial
> to a new feature/function, check if it possible to provide a clear
> path that can be used to replace the old functionality."
>
> The best way (imho) would be a clear warning/error message showing the
> cause and the alternative. An imaginary example

I completely agree. You called out, recently, the exemplary diagnostic output
of Raku. We should strive to provide better diagnostics *in general*, but also
especially when we're bringing change that isn't opt-in.

We'll reduce inconvenience if we can always provide something like, at minimum,
"We are deprecating Perl's support for foozles. Consider using the new blorts
system. You can find more at [this] resource."

--
rjbs
Re: on changing perl's behavior [ In reply to ]
On Saturday, 17 April 2021, 19:35:57 CEST, Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote:
> I completely agree.  You called out, recently, the exemplary diagnostic output
> of Raku.  We should strive to provide better diagnostics *in general*, but also
> especially when we're bringing change that isn't opt-in.

If that's to be done, it might be interesting to rethink diagnostics in terms of the larger context and not just the messages. For example, a core exception system would be good. First pass could be converting all diagnostics to exceptions and when we get a "use of uninitialized value in $foo" it would be interest if the developer could rerun the program:
    PERL_DIAG=verbose,trace perl path/to/fail.pl
Note that I'm not suggesting that as an interface! It's the concept which I think is important here. Different developers have different needs and I almost  never want extra info in diagnostics (though I'd often kill for a stacktrace). But if I get a "bizarre copy of array in list assignment" error, I absolutely want more info.

Best,Ovid
-- IT consulting, training, specializing in Perl, databases, and agile developmenthttp://www.allaroundtheworld.fr/. 
Buy my book! - http://bit.ly/beginning_perl
Re: on changing perl's behavior [ In reply to ]
On Sun, Apr 18, 2021, at 2:28 AM, Ovid wrote:
> On Saturday, 17 April 2021, 19:35:57 CEST, Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote:
>
>> I completely agree. You called out, recently, the exemplary diagnostic output
>> of Raku. We should strive to provide better diagnostics *in general*, but also
>> especially when we're bringing change that isn't opt-in.
>
> If that's to be done, it might be interesting to rethink diagnostics in terms of the larger context and not just the messages.

I agree, but I'd rather not let the better be the enemy of the "good enough for now." I put in some work, ages ago, to try to move us toward more structured errors and diagnostics, and it more or less went nowhere. While I'm happy to make another go of it, improving the text of text warnings is an interim good.

--
rjbs

1 2 3  View All