Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Apparently a previous posting of mine has been picked up by Perl-bashers. In retrospect, I shouldn't have been surprised. But I was.

The post I'm talking about proved the long-conjectured idea that Perl parsing reduces to the Halting Problem and is therefore not, in general, decidable. Stating that as "Perl is Unparseable" is a bit dramatic, but that was the terminology used in the discussion when I found it.

Unparseability is not a feature Perl folks need to be defensive about, or to minimize. Unparseability is one of the great things about Perl. OK, not unparseability in and of itself, but the ability to use the full power of the language at parse time. Because that full Turing machine power is what produces unparseability as a side effect.

Compile-phase processing is heavily used in Perl, and having the full language available at that point is one of its major advantages over other languages. That's why nobody ever talks about "fixing" Perl's unparseability. It's not a problem and doesn't need a fix.

With the usefulness of having the full language in the compile phase, contrast the unparseability downside: yes, there are potential Perl programs that cannot be parsed. None I've ever wanted to actually use, mind you. The only Perl programs I've encountered that don't parse are the artificial ones invented for the discussion of unparseability.

So the trade-off is practical power for theoretical purity. Thank you, Larry Wall. And, hey, designers of other languages! How come you didn't make such a smart trade-off?

So, monks, next time you hear Perl jeered at for having undecidable parsing, just tell 'em -- demanding a parseable language is the sign of weak programmer.

[ My proof is available in a series of three articles in The Perl Review, now available online. The TPR articles should be preferred to my original post because they are more fully explained, were carefully rewritten, and benefited from editing by brian d foy. ]


In reply to Unparseability is A Good Thing by Jeffrey Kegler

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-23 17:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found