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

Re: "no snails"; or having signatured subs complain about @_

Thread Previous | Thread Next
Felipe Gasper
December 10, 2021 17:25
Re: "no snails"; or having signatured subs complain about @_
Message ID:

> On Dec 10, 2021, at 12:19, Dave Mitchell <> wrote:
> On Thu, Dec 09, 2021 at 04:58:57PM -0500, Dan Book wrote:
>>> Having read the prior arguments, I'm kinda with Dave on this one.
>>> @DB::args is already shockingly broken in a lot of ways. Making it
>>> always appear empty when called within a signatured sub is, honestly,
>>> not the worst of its already-current breakages.
>> This isn't going to be much consolation to users who are currently relying
>> on it and have not experienced the bugs.
> But @DB::args (and thus croak() stack trace argument display etc) would
> only disappear on signature subs. No existing code not using experimental
> features would be affected.
> And it's only ever been intended for use in debugging etc, not in
> production.

Debugging is the context where it _matters_, though, to have as much detail as possible. Having the arguments in stack traces has been a boon over the years.

We know the liabilities this will entail … do we yet know any more about the potential performance wins from it? If they’re significant, then it’s at least a fair trade: trickier debugging for the sake of a palpable speed bump. But if the speed benefits aren’t going to make a real-world difference, then maybe leave @_ as it is?

At the very least, args-less Perl stack traces will be no _worse_ than the args-less stack traces in other languages I’ve debugged.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About