Live data from Hacker News

Perl and Undecidability (2008)

jeffreykegler.com

11–20 of 127 posts

Re: Perl and Undecidability (2008)

#11
post #5

For the people out there that's not so into CS, and does not understands it's implications. It basically means you could write a perl program that could cause an infinite loop in the interpreter (or compiler). This I would presume independant of the actual implementation of the compiler and intrepreter as that would only mean this is a bug report for the specific implementation, and not a problem with the language de…

Actually the problem has more implications, as it's an effect of parsing the code. Any IDE:s that have advanced features that rely on parsing and analysis of the code can be caught in an infinite loop and stop responding.

The sad part is, in the general case it's impossible for the parser (or any other process overviewing it) to decide if it's actually caught in an infinite loop or not, that's why they call it undecidability.

Re: Perl and Undecidability (2008)

#12

You know there was that recent Stackoverflow analysis that concluded that Perl was the most disliked programming language? It got me to thinking about how Perl managed to become quite so profoundly disliked, and I remembered these papers and thought that maybe things like this are the reason.

Perl used to have fans with meetups and so on. I've not heard of these for a long time.

IMO three things killed Perl, leaving it as an unpopular legacy husk:

- loss of ecosystem. The high points for Perl were CGI.pm and its use as a "super awk" by sysadmins. The first was obliterated by other ecosystems, better and worse: PHP, Rails, Node, Go, and so on. The second was obliterated by "servers are cattle not pets": people have moved from meticulous hand-administration to the use of containers, Ansible, etc - or away from systems administration altogether to AWS or "serverless".

- Perl 6 transition. Second-system effect at its highest. The long wait for this to be completed absolutely destroyed incremental improvement because everyone was waiting for a big bang that came very late. Python managed to avoid this level of community damage but has still split into two languages, Python 2 and Python 3.

- the "two Perls" of style; one was the Wall-influenced style that looked a bit like English. The other was sigil-heavy and incomprehensible. Eventually people decided that it was easier to put up with syntactic whitespace than remember all the $? and $| and so on, so a lot of the Perl audience moved to Python.

Re: Perl and Undecidability (2008)

#14
post #8

You know there was that recent Stackoverflow analysis that concluded that Perl was the most disliked programming language? It got me to thinking about how Perl managed to become quite so profoundly disliked, and I remembered these papers and thought that maybe things like this are the reason.

>how Perl managed to become quite so profoundly disliked I'm guessing the reasons are actually more conspicuous than computer science concepts of "undecidability" since most working programmers don't read academic papers to judge whether they like/disklike a programming language. The conspicuous reasons seem to be a combination of: 1) PERL's usage of sigils.[1] One the one hand, it makes code compact and terse . On t…

Point 2 is kind of nonsense. The ecosystem is incredibly big and keeps up with most things. Name something then search here https://metacpan.org/ The main missing stuff is anyone marketing heavily their libraries and there being communities around them etc. Like probably no one knows what PDL is, even though it was around long before numpy+scipy etc. Before data science trended in the mind of hipster VCs and coders. The naming was to try and win over people from the IDL language, used mostly in image analysis in physics/geography. A niche crowd to be sure. Perl sort of never caught on to the modern style of advertising what its got. In the same way no one really advertises grep, awk or sed but lots of people still learn and use them.

Re: Perl and Undecidability (2008)

#15
post #8

You know there was that recent Stackoverflow analysis that concluded that Perl was the most disliked programming language? It got me to thinking about how Perl managed to become quite so profoundly disliked, and I remembered these papers and thought that maybe things like this are the reason.

>how Perl managed to become quite so profoundly disliked I'm guessing the reasons are actually more conspicuous than computer science concepts of "undecidability" since most working programmers don't read academic papers to judge whether they like/disklike a programming language. The conspicuous reasons seem to be a combination of: 1) PERL's usage of sigils.[1] One the one hand, it makes code compact and terse . On t…

Why do you write it in all capitals?

Re: Perl and Undecidability (2008)

#16
post #8

Earlier quoted context omitted.

>how Perl managed to become quite so profoundly disliked I'm guessing the reasons are actually more conspicuous than computer science concepts of "undecidability" since most working programmers don't read academic papers to judge whether they like/disklike a programming language. The conspicuous reasons seem to be a combination of: 1) PERL's usage of sigils.[1] One the one hand, it makes code compact and terse . On t…

Why do you write it in all capitals?

Because they don't know much about contemporary Perl. It's actually a really good indicator of if someone actually knows anything about the language post the 90s. I used it as a soft hiring filter on CVs. You knew almost as matter of fact any dev putting that on their CV was self taught from monster nests of legacy.

Re: Perl and Undecidability (2008)

#17
post #12

You know there was that recent Stackoverflow analysis that concluded that Perl was the most disliked programming language? It got me to thinking about how Perl managed to become quite so profoundly disliked, and I remembered these papers and thought that maybe things like this are the reason.

Perl used to have fans with meetups and so on. I've not heard of these for a long time. IMO three things killed Perl, leaving it as an unpopular legacy husk: - loss of ecosystem. The high points for Perl were CGI.pm and its use as a "super awk" by sysadmins. The first was obliterated by other ecosystems, better and worse: PHP, Rails, Node, Go, and so on. The second was obliterated by "servers are cattle not pets": pe…

> Python managed to avoid this level of community damage but has still split into two languages, Python 2 and Python 3.

The fracture is very slowly healing. Outside of some huge corporate hold outs with a lot of Python 2 code (Google & co.), Python 3 will win out.

Perl 6 vs Perl 5, on the other hand, I don't even know if you can call it a fracture. A new start would be more fitting.

Re: Perl and Undecidability (2008)

#18
post #12

You know there was that recent Stackoverflow analysis that concluded that Perl was the most disliked programming language? It got me to thinking about how Perl managed to become quite so profoundly disliked, and I remembered these papers and thought that maybe things like this are the reason.

Perl used to have fans with meetups and so on. I've not heard of these for a long time. IMO three things killed Perl, leaving it as an unpopular legacy husk: - loss of ecosystem. The high points for Perl were CGI.pm and its use as a "super awk" by sysadmins. The first was obliterated by other ecosystems, better and worse: PHP, Rails, Node, Go, and so on. The second was obliterated by "servers are cattle not pets": pe…

It's more caused by the toxic climate amongst it's maintainers, paired with technical and management incompetence.

When Larry Wall was still the lead a lot of progress was made, but then it reversed course in the last 20 years. Every single competent developer left or was booted, and not a single of the many designed features for Perl6 were properly implemented in perl5. Perl5 is now purely a religion, with the heresy to express of loss of faith in the supreme leaders gets you booted, whilst uncivil name-calling and technical destruction by wannabe middle-managers took over.

The undecidedability problem is caused by the dynamic lexer. It's actually a feature to drive the static parsing rules dynamically.

Re: Perl and Undecidability (2008)

#19

You know there was that recent Stackoverflow analysis that concluded that Perl was the most disliked programming language? It got me to thinking about how Perl managed to become quite so profoundly disliked, and I remembered these papers and thought that maybe things like this are the reason.

Perl is designed to make life easier for the guy who writes the code, not the one who reads it.

The motto "there is more than one way to do it" is telling. It allows beginners to write code the way they are most familiar with and give experts a large toolbox to be most efficient in many situations. The trouble is that while the writer only needs to know a subset of the language, the reader has to know everything in order to read other people code.

This philosophy make it very suitable for quick hacks, and that's its primary use. The problem is that quick hacks have a tendency to stay, and some poor guy need to maintain that mess. And when your experience with the language is to maintain the unmaintainable, hate is totally justified.

Note that is is possible to write clean Perl, but it requires effort, and unless you are writing Perl modules, there are probably better languages for that.

Compiler undecidablity is not a problem. Sure, it is not intellectually satisfying, and it may be troublesome for some application where formal proofs are required, but for a language like Perl that is all about practicality, no one really care.

Re: Perl and Undecidability (2008)

#20
post #5

For the people out there that's not so into CS, and does not understands it's implications. It basically means you could write a perl program that could cause an infinite loop in the interpreter (or compiler). This I would presume independant of the actual implementation of the compiler and intrepreter as that would only mean this is a bug report for the specific implementation, and not a problem with the language de…

perl works fine, and you aren't going to unexpected trigger an infinite loop due to some bug in the language definition.

What you can't do is tell how to parse a piece of perl without running the program.

http://www.perlmonks.org/?node_id=663393

These are an expounding upon this link. In most languages, you can at least tell what things are. This is a function. That's a variable. In perl, there are constructs whose parsing depend on what a given bit of code was defined as previously, and that definition can be predicated on code execution. This leaves you in a situation where you cannot tell if something is a division and comment or a regex without knowing whether a function takes arguments. ( see link )

Post reply on HN