Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
The stupid question is the question not asked
 
PerlMonks  

Re^6: Perl is not Dynamically Parseable

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


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

it's impossible to predict the meaning Perl will assign to code in some circumstances
That's what I thought you must have meant. I guess we have different working definitions of what "deterministic" means.

In this case, one could even argue that it's not really a matter of determining what meaning Perl assigns to some code, but a matter of determining whether Perl will get around to assigning meaning to some code.

blokhead


Comment on Re^6: Perl is not Dynamically Parseable
Re^7: Perl is not Dynamically Parseable
by ikegami (Pope) on Oct 13, 2009 at 23:27 UTC

    I guess we have different working definitions of what "deterministic" means.

    Wikipedia says:

    A deterministic algorithm is an algorithm which, in informal terms, behaves predictably. Given a particular input, it will always produce the same output, and the underlying machine will always pass through the same sequence of states.

    Perl's parser, due to it's pluggable nature, does not adhere to that definition. The output can vary for a given input, and it varies because the underlying states visited vary.

    I've looked at more format definitions elsewhere and reached the same conclusion.

    In this case, one could even argue that it's [...] a matter of determining whether Perl will get around to assigning meaning to some code.

    When one discuses whether Perl can be parsed or not, one is not referring to the time it takes or even if it's finite. One is discussing whether the output is stable enough to study or store for future use.

    Let's take C++ for example. One would consider C++ to be parseable. One can perform static analysis on C++ code. C++ code can be compiled. Yet, it's possible to introduce an infinite loop in the parser because C++'s template system is turing complete.

    The difference between C++ and Perl is that C++'s parser is confined to making decision based on its input, whereas Perl's parser can make decision based on external data.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2014-04-19 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (480 votes), past polls