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

Re: De-experimentalising "signatures"

Thread Previous | Thread Next
Paul "LeoNerd" Evans
March 27, 2021 12:39
Re: De-experimentalising "signatures"
Message ID:
On Fri, 26 Mar 2021 22:28:30 -0700
Darren Duncan <> wrote:

> I would propose and expect that @_ should continue to behave the same
> as it always did, and be available in every subroutine, and that
> signatures just provides an overlay plus constraint check.
> The key thing is that I consider access to a single value
> representing the entire collection of actual arguments to be an
> important fundamental feature that should never go away.

I don't think anyone is suggesting to get rid of @_ because they don't
"like" it, or it's messy or confuses newbies or anything.

The primary motivation to get rid of @_ is that it is slow. It is a
large performance drain on the overhead of the ENTERSUB op, which is
involved in every single function call that Perl ever makes. If we were
able to skip that part for the majority of subs which don't need it
(because they'd be written with signatures), then the entire program
runs faster.

Performance is a feature.

Paul "LeoNerd" Evans      |  |

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