Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement wrapper subs in C or XS #32

Open
nthykier opened this issue Jul 26, 2013 · 3 comments
Open

Implement wrapper subs in C or XS #32

nthykier opened this issue Jul 26, 2013 · 3 comments
Labels

Comments

@nthykier
Copy link
Contributor

The idea to implement autodie in C was mentioned in evalEmpire/perl5i#102. While it may just improve the speed in itself, it may also open the door to cache subs much more aggressively.
According to [1], XS are invisible in "caller" so a lot of issues we have preventing reuse /might/ just disappear once the checker sub "disappears" from the call stack.

~Niels

[1] http://perl5.git.perl.org/perl.git/commitdiff/1d56df500dec0bf9de438b0fa225eb363b006dcf

@pjf
Copy link
Collaborator

pjf commented Sep 21, 2013

If we have skilled C/XS folks, we may even be able to wrap say/print. :)

@nthykier
Copy link
Contributor Author

On 2013-09-21 04:40, Paul Fenwick wrote:

If we have skilled C/XS folks, we may even be able to wrap say/print. :)

I think to wrap say or print, we pretty much have to swipe it out at the
op-code level. The problem with these is that there is no prototype
that can describe their call interface, so we need perl's parse to
"translate" the call for us and the substitute print with "checked_print".
That said, if/once we start doing XS stuff, we can probably get away
with doing this for all CORE subs we check. I am pretty sure we can do
this in a resuable manner[1] and with less runtime overhead than PP.

~Niels

[1] In particular, if we are messing with op tree, we won't need leak
guards.

@nthykier
Copy link
Contributor Author

For reference, @schwern wrote some code for including autodie behaviour directly in perl code (see evalEmpire/parfait/issues/16 and https://github.com/evalEmpire/perl5ic/tree/autodie)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants