tim: Tim with short hair, smiling, wearing a black jacket over a white T-shirt (Default)
[personal profile] tim
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.

(no subject)

Date: 2009-08-13 04:48 pm (UTC)
From: [identity profile] wkfauna.livejournal.com
Heh, that's an amusing proof. Anyway, I don't think the commenter could be called a computer scientist -- after all, they reject computer *science*. It's possible to be a computer user without being a computer scientist, but I wish more users-not-scientists would stop feeling insecure about it and manifesting their insecurity whenever they can.

(no subject)

Date: 2009-08-13 04:55 pm (UTC)
From: [identity profile] wkfauna.livejournal.com
Iunno. The commenter uses Perl and doesn't care whether it's parseable. They have no use for a static analyzer or other niftiness that would be made possible otherwise. I don't think it's a failure to not have convinced them of the usefulness of these things they don't need.

(no subject)

Date: 2009-08-13 05:00 pm (UTC)
From: [identity profile] wkfauna.livejournal.com
I work in Perl, and I don't really care in a practical sense. It's a consideration in whether to use the language or not, I guess, but it's not going to stop me. I don't know about other people.

Besides, there's always XS... *shudder*

(no subject)

Date: 2009-08-13 05:12 pm (UTC)
From: [identity profile] wkfauna.livejournal.com
Oh well yeah. Candidate B would have to work very hard to make up the points they lost for that comment. But if there were a candidate C that said "Oh, that proof is nifty, but I guess I don't really care on a day-to-day basis", that would be a neutral statement unless it was delivered in a snarky way.

(no subject)

Date: 2009-08-13 05:17 pm (UTC)
From: [identity profile] wkfauna.livejournal.com
Yeah, exactly. Somebody with no curiosity and a disdain for the "high falutin' ivory tower mumbo jumbo" is probably going to be annoying to work with and probably not as good at their job as they could otherwise be (where do you get if you refuse to ever read any papers?).

(no subject)

Date: 2009-08-13 05:02 pm (UTC)
From: [identity profile] wkfauna.livejournal.com
Also, I think many people who like Perl like it for its expressiveness, which is (at least part of) what makes it unparseable.

(no subject)

Date: 2009-08-13 04:54 pm (UTC)
From: [identity profile] sethg-prime.livejournal.com
Considering how many professionals in the IT world can't read or write their way out of a paper bag, "major in English and then get a job as a programmer" is not an entirely dumb career plan.

(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 06:09 pm (UTC)
asrabkin: (Default)
From: [personal profile] asrabkin
Okay, I'm now confused. Why is it so bad to have a language which can't always be parsed? That just means that if I hand some horrible grungy code to the perl parser, it'll gronk for a while, and at some point give up, even if by trying more parse trees, it might have found a valid one.

Why is this worse than having a language with an undecidable type system?

(no subject)

Date: 2009-08-13 06:21 pm (UTC)
asrabkin: (Default)
From: [personal profile] asrabkin
I didn't have a particular Turing-complete type system in mind -- I knew that some research languages had that property, and that it wasn't considered a per-se crazy thing to do.

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:40 pm (UTC)
asrabkin: (Default)
From: [personal profile] asrabkin
Mm. I think if you're programming in perl, you probably already know that you won't have a lot of confidence in it. People joke about perl being a write-only language -- if you care about your program, and you expect to be maintaining it, you shouldn't be doing it in perl anyway, so the fact that it's hairy in a deep computational sense is maybe irrelevant, given that it's hairy and error-prone in every other way, too. It's sort of satisfying to know that the defects in perl really are deep and fundamental; but even the ephemeral and shallow defects are quite serious enough that anybody using perl for something critical should have their programming license revoked.

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 07:23 pm (UTC)
From: [identity profile] wkfauna.livejournal.com
It really is possible to write elegant, efficient and maintainable Perl. I've worked at two companies with very large codebases that fit this description.

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)
From: [identity profile] wkfauna.livejournal.com
One of the main selling points of Perl is its syntactic expressiveness. I don't think implementation sloppiness is the main reason why the grammar is undecidable.

(no subject)

Date: 2009-08-13 08:01 pm (UTC)
From: [identity profile] wkfauna.livejournal.com
Heh, no, because your "easily accomplished" clause is too broad (what's easy? what's another mechanism? does conciseness count? etc). But the example "whatever" clause in the original post is interesting and shows some features that are each either neat or horrible, depending on your point of view:
* 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)
luinied: The Twilight Rune (Default)
From: [personal profile] luinied
Has any academic discipline convinced industry to do more than the bare minimum necessary for siphoning money from consumers / other industries? Also, people I know who majored in English have their own complaints, and not just about it being hard to find jobs.

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)
From: [identity profile] rjmccall.livejournal.com
Hey, perlmonks! That's the site that got hacked recently where the hackers discovered that all the passwords were left unencrypted in a database.

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.

Profile

tim: Tim with short hair, smiling, wearing a black jacket over a white T-shirt (Default)
Tim Chevalier

September 2014

S M T W T F S
 1234 56
78 910 111213
1415 16 17 18 1920
21 22 2324252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags