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

Should we hide private functions?

Thread Next
From:
Tomasz Konojacki
Date:
June 14, 2022 12:42
Subject:
Should we hide private functions?
Message ID:
20220614144151.F6BB.5C4F47F8@xenu.pl
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?

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