![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
A blog comment in response to an argument that writing a parser for Perl is Turing-complete:
"That's some mighty fine left brain thinking there( especially for a Monday morning ), but does it in anyway affect any practical aspect of Perl? Like can it be used to show that Perl is more or less reliable/secure? This isn't a criticism of your node, but I left college 35 years ago, and this sort of analysis seems very ivory-tower-ish to me now. It's sort of like saying 'one cannot prove self-existence'. Is the fact that Perl cannot parse itself a good or bad thing, or can other languages do it? Does that make them superior?"
Computer science is an intellectual and pragmatic failure. Kids, if you're looking for a good career, major in English.
"That's some mighty fine left brain thinking there( especially for a Monday morning ), but does it in anyway affect any practical aspect of Perl? Like can it be used to show that Perl is more or less reliable/secure? This isn't a criticism of your node, but I left college 35 years ago, and this sort of analysis seems very ivory-tower-ish to me now. It's sort of like saying 'one cannot prove self-existence'. Is the fact that Perl cannot parse itself a good or bad thing, or can other languages do it? Does that make them superior?"
Computer science is an intellectual and pragmatic failure. Kids, if you're looking for a good career, major in English.
(no subject)
Date: 2009-08-13 04:48 pm (UTC)(no subject)
Date: 2009-08-13 04:51 pm (UTC)(no subject)
Date: 2009-08-13 04:55 pm (UTC)(no subject)
Date: 2009-08-13 04:56 pm (UTC)(no subject)
Date: 2009-08-13 05:00 pm (UTC)Besides, there's always XS... *shudder*
(no subject)
Date: 2009-08-13 05:09 pm (UTC)(no subject)
Date: 2009-08-13 05:12 pm (UTC)(no subject)
Date: 2009-08-13 05:14 pm (UTC)(no subject)
Date: 2009-08-13 05:17 pm (UTC)(no subject)
Date: 2009-08-13 05:02 pm (UTC)(no subject)
Date: 2009-08-13 04:54 pm (UTC)(Yeah, yeah, I know, people with English degrees can't necessarily write their way out of a paper bag, either....)
(no subject)
Date: 2009-08-13 04:55 pm (UTC)(no subject)
Date: 2009-08-13 06:09 pm (UTC)Why is this worse than having a language with an undecidable type system?
(no subject)
Date: 2009-08-13 06:11 pm (UTC)Which languages with undecidable type systems do you have in mind? Some languages that use dependent types have that property, but that is indeed a common criticism of such languages, and AFAIK all are research languages, with none of them seeing as much use as Perl.
(no subject)
Date: 2009-08-13 06:21 pm (UTC)I don't actually see why "parsing is/can be as hard as evaluation" is necessarily a problem. This seems like one of those very loose lower bounds we get a lot in CS -- where some problem has very hard instances, but in practice, the instances we care about are generally OK.
This is certainly an implementational headache, and a limitation for people who want to do program analysis, but I don't see it as directly relevant users. This property limits the variety and power of perl-analysis tools, but if I was dissatisfied with the offerings out there, I shouldn't be using perl anyway.
(no subject)
Date: 2009-08-13 06:28 pm (UTC)In general, people are beginning to see that they need to be able to reason about their programs. If you want to know something about your code, you also need to know something about the language environment you're using to execute it (remember the whole what-you-see-is-what-you-execute idea from Grammatech?) In general, proving a compiler correct is a very hard problem. If you were going to write a Perl compiler, there would be very little you could prove about it given that you can't even write a parser that is guaranteed to tell you in a finite amount of time whether your program is syntactically valid.
You might say that if someone is programming in Perl, then they don't care about reasoning, but it is at least important for a Perl programmer to be aware of how low their confidence must be that their programs will do what they expect. "Reasoning" means that you can predict what a program will do by thinking about it logically and you don't have to resort to finding out through the scientific method. That it's so difficult to reason about Perl is a shortcoming of the language and it's worrisome to see people dismissing it as "ivory tower nonsense".
(no subject)
Date: 2009-08-13 06:40 pm (UTC)It's a language designed for knocking out short little scripty things, that probably only get run a handful of times. And yeah, certainly, nobody ought to design a language like perl in the future -- but precisely the problem with perl is that it grew by accretion.
(no subject)
Date: 2009-08-13 06:45 pm (UTC)(no subject)
Date: 2009-08-13 07:23 pm (UTC)Perl, however, is noob-friendly enough to allow even unskilled people to write programs that work, and also geek-friendly enough to allow people to run Perl golf contests. These two groups, IMO, give it an unfair write-only reputation.
(no subject)
Date: 2009-08-13 07:23 pm (UTC)(no subject)
Date: 2009-08-13 07:43 pm (UTC)(no subject)
Date: 2009-08-13 08:01 pm (UTC)* passing args without parens
* implicit matching on $_ and the existence of $_
* void context and the lack of failure thereof
Anyway, I'm not here to argue for the beauty of the design of Perl, 'cause even I think it's horrible. There's certainly plenty of design and implementation sloppiness there to go around. One just has to look at the way sort works to be convinced of that (hint: it involves manipulating symbol tables).
(no subject)
Date: 2009-08-13 07:03 pm (UTC)I do like that proof, though. And, unlike with the last comment you quoted, I could respond to that line of skepticism with something better than just swearing.
(no subject)
Date: 2009-08-13 10:01 pm (UTC)Their proof is pretty silly. Perl has metaprogramming/module-initialization hooks; those hooks can create or modify type signatures; type signatures affect parsing. Now, "type signatures affect parsing" is an unfortunate design decision, but that's not what really* makes parsing Perl Turing-complete --- no, it's the metaprogramming. I mean, Lisp/Scheme compilation is also Turing-complete.