Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^6: Perl 5 Optimizing Compiler, Part 9: RPerl.org & The Low-Magic Perl Commandments

by Will_the_Chill (Pilgrim)
on Nov 12, 2013 at 09:28 UTC ( [id://1062158]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Perl 5 Optimizing Compiler, Part 9: RPerl.org & The Low-Magic Perl Commandments
in thread Perl 5 Optimizing Compiler, Part 9: RPerl.org & The Low-Magic Perl Commandments

Hi Jenda,

Thanks for your reply! You're right about the amount of pre-existing low-magic Perl code, as we are now getting started with RPerl there is not much low-magic code already out there. The RPerl team will provide common shared libraries and algorithms, and we'll also work to de-magicify some important CPAN modules as well.

Perhaps the most important part of this concern is already clearly codified in The Low-Magic Perl Commandments. We are directed to populate CPAN with low-magic Perl code:

LMPC #10. Thou Shalt Use & Contribute To Low-Magic Pure-Perl CPAN Code

If you are passing magical things into RPerl code, then you're breaking the rules:

LMPC #11. Thou Shalt Not Use XS, High-Magic Perl, Or High-Magic CPAN Code, Except During Official Emergencies PBP 228 Conflict

So feel free to mix high-magic and low-magic code in the same program, just don't try to pass high-magic things into the low-magic parts of the program. RPerl will (at least) just throw away the magic or (at most) tell you that you are wrong, and you will be unhappy.

Does that answer your questions?

Thanks,
~ Will
  • Comment on Re^6: Perl 5 Optimizing Compiler, Part 9: RPerl.org & The Low-Magic Perl Commandments

Replies are listed 'Best First'.
Re^7: Perl 5 Optimizing Compiler, Part 9: RPerl.org & The Low-Magic Perl Commandments
by salva (Canon) on Nov 12, 2013 at 09:48 UTC
    RPerl will (at least) just throw away the magic or (at most) tell you that you are wrong

    Is it not possible to just fallback to the "slow" perl interpreter when magic is detected?

      salva,

      You are correct! The default behavior will be for RPerl to fall back to normal high-magic mode if any not-low-magic code is encountered. I should've been more clear, what I was describing was an attempt to force RPerl to accept high-magic code, resulting in losing magic and/or errors.

      Thanks for pointing that out!

      Perling,
      ~ Will the Chill
        if any not-low-magic code is encountered

        I hope you mean not-low-magic data here!

        If I call some low-magic sub passing non-magic arguments I would expect it to run fast under RPerl.

        If I call some low-magic sub passing some argument with magic attached I would expect it to run correctly even if not faster.

        I would expect that to happen dynamically without me, the programmer, having to worry about where my data comes from or where it goes.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1062158]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-19 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found