develooper Front page | perl.perl5.porters | Postings from June 2022

Re: Should we hide private functions?

Thread Previous | Thread Next
From:
Karl Williamson
Date:
June 14, 2022 16:32
Subject:
Re: Should we hide private functions?
Message ID:
b589719c-dabc-0003-7481-53e020dfbb80@khwilliamson.com
On 6/14/22 06:41, Tomasz Konojacki wrote:
> The current situation is that private non-static functions are callable
> from XS modules on all platforms *except Windows*. I have submitted a PR
> that makes them non-callable on almost all the other platfroms:
> 
> https://github.com/Perl/perl5/pull/19655
> 
> It's a pretty major change and that PR hasn't received much attention,
> so I'm making this post to get your opinions.
> 
> This change will likely cause some CPAN breakage. I imagine there will
> be three kinds of breakages:
> 
> 1. Modules that call functions that shouldn't have been marked as
> private.
> 
> 2. Modules that call private functions for no reason and can be easily
> patched to use public functions instead.
> 
> 3. Modules that call private functions to accomplish something that
> can't be done with public APIs
> 
> 1 & 2 are easily fixable. Number three may require us to either design
> new APIs or just expose the needed private APIs and call it a day.
> 
> On #p5p, randir has expressed a concern that the breakage may be
> unacceptable. My opinion is that we're very early in the release cycle
> and we have plenty of time to deal with the potential fallout. Also, it
> can't be *that* big considering that most of CPAN works on Windows just
> fine.
> 
> What does p5p think?


I concur with your analysis.  I've been waiting for this to be merged, 
and I think we should do it now, fixing things up as needed.

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