Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by salva (Monsignor)
on Nov 12, 2013 at 09:48 UTC ( #1062163=note: print w/ replies, xml ) Need Help??


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

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?


Comment on Re^7: Perl 5 Optimizing Compiler, Part 9: RPerl.org & The Low-Magic Perl Commandments
Re^8: Perl 5 Optimizing Compiler, Part 9: RPerl.org & The Low-Magic Perl Commandments
by Will_the_Chill (Pilgrim) on Nov 12, 2013 at 10:09 UTC
    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.

        salva,

        You are correct in your assessment that no-magic args (data) passed to a low-magic subroutine (operation) will run faster under RPerl, and magic args passed to a low-magic subroutine will fall back to run slowly and correctly.

        When I said "any not-low-magic code", that is in fact what I meant. I was making a general statement that RPerl will fall back to slow high-magic mode whenever any magic data OR magic operations are encountered. Args to subs count as data, the subs count as ops, and any builtins or sub calls inside the sub also count as ops. We're currently extending the use of the term "magic" to include both magic data and ops that do magical'ish things. (See previous comments in this thread about use of the term.) Sorry for any confusion.

        If you wonder what counts as "magic" operations, look at The Low-Magic Perl Commandments under the "Operations" section.

        Perling,
        ~ Will

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (11)
As of 2014-07-22 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (106 votes), past polls