Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Perl is not Dynamically Parseable

by blokhead (Monsignor)
on Oct 13, 2009 at 00:29 UTC ( #800824=note: print w/ replies, xml ) Need Help??


in reply to Re: Perl is not Dynamically Parseable
in thread Perl is not Dynamically Parseable

I'm not sure what you mean here by "two instances of the Perl parser". I'm pretty sure I know what you're getting at, but I wouldn't call it two instances of the parser. It is more like two possible syntactic interpretations/parses of the same piece of code, depending on the prototype of a previously defined sub.

Saying "two instances of the parser" produce different things (on the same given code, presumably) makes it sound simply like the parser is non-deterministic or randomized.

blokhead


Comment on Re^2: Perl is not Dynamically Parseable
Re^3: Perl is not Dynamically Parseable
by ikegami (Pope) on Oct 13, 2009 at 00:54 UTC

    It is more like two possible syntactic interpretations/parses of the same piece of code,

    And what produces those two possible parses? Two parser instances. We're saying the same thing.

    Saying "two instances of the parser" produce different things (on the same given code, presumably) makes it sound simply like the parser is non-deterministic or randomized.

    Good.

      I don't know what the halting problem has to do with non-deterministic or randomized programs. The perl parser is deterministic, and it does not toss random coins. You can certainly insert randomness into a BEGIN block, but that's not what's going on here and it doesn't mean that parsing itself is randomized. Jeffrey's examples & undecidability proofs all involve deterministic BEGIN phases. If you run the parser a billion times on a deterministic program, you will get the same result every time. Different instances of the parser do not give different parses. The only way to get different parses is by having different behavior within the BEGIN block.

      blokhead

        The perl parser is deterministic,

        Parsing is the activity of assigning meaning to code. Since it's impossible to predict the meaning Perl will assign to code in some circumstances, the parser is non-determinisitc.

        Something I missed:

        Different instances of the parser do not give different parses.

        They do for some program. Did you (incorrectly) think I said it would happen for all programs? I said that once one finds a program where this happens, one can prove the non-parsability of Perl.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-07-31 06:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (245 votes), past polls