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. ]
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Unparseability is A Good Thing
by zby (Vicar) on Aug 23, 2009 at 13:30 UTC | |
by ikegami (Patriarch) on Aug 23, 2009 at 15:46 UTC | |
by ikegami (Patriarch) on Aug 23, 2009 at 15:53 UTC | |
by Zen (Deacon) on Aug 26, 2009 at 19:51 UTC | |
by blokhead (Monsignor) on Aug 28, 2009 at 14:01 UTC | |
by ikegami (Patriarch) on Aug 27, 2009 at 21:45 UTC | |
by Zen (Deacon) on Aug 28, 2009 at 13:31 UTC | |
| |
by ikegami (Patriarch) on Aug 26, 2009 at 22:18 UTC | |
by Zen (Deacon) on Aug 27, 2009 at 13:55 UTC | |
| |
by blokhead (Monsignor) on Aug 23, 2009 at 15:06 UTC | |
Re: Unparseability is A Good Thing
by jdrago_999 (Hermit) on Aug 24, 2009 at 17:55 UTC | |
Re: Unparseability is A Good Thing
by papidave (Pilgrim) on Aug 26, 2009 at 21:37 UTC |