Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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

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


in reply to Re^3: 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,

My only use of old English is The Book Of RPerl, and perhaps to a trivial degree the use of "thou shalt" and "thou shalt not" in The Low-Magic Perl Commandments. Just for you, just in this post, I'll replace "Thou Shalt Not" with "DON'T". :-)

To address your concerns, globals are not allowed and tied variables are not allowed.

LMPC #17. DON'T Use Dynamic-Type Data, Auto-Vivification, Or Tied Variables

LMPC #19. DON'T Use Private Dynamic-Scope (“local”), Private Persistent Lexical-Scope (“state”), Global, Or Package Variables (“our”)

Does that answer your questions?

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

Replies are listed 'Best First'.
Re^5: Perl 5 Optimizing Compiler, Part 9: RPerl.org & The Low-Magic Perl Commandments
by Jenda (Abbot) on Nov 12, 2013 at 08:19 UTC

    No it doesn't. The point is that you can't compile a piece of code without magic, because the magic may come from the outside. So even if YOU do follow all those commandments, someone else might not. The result is that even if you do follow all those commandments to the letter, the amount of code that may be safely compiled in a no-magic mode is gonna be fairly small.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

      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
        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?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-19 20:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found