TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Perl and Undecidability (2008)

67 pointsby gfredtechover 7 years ago

10 comments

SonOfLilitover 7 years ago
C++ is also undecidable, by the way: <a href="http:&#x2F;&#x2F;blog.reverberate.org&#x2F;2013&#x2F;08&#x2F;parsing-c-is-literally-undecidable.html" rel="nofollow">http:&#x2F;&#x2F;blog.reverberate.org&#x2F;2013&#x2F;08&#x2F;parsing-c-is-literally-u...</a><p>Perl was a great language design lab experiment. They gave people 20 ways to do any simple thing, and then Matz and Guido looked to see which ways became popular and designed great languages that allow only those ways and maybe 1-2 more that are highly frowned upon. I&#x27;m almost as glad Perl exists as I am that I never needed to learn it.
评论 #15740997 未加载
评论 #15739408 未加载
评论 #15739369 未加载
评论 #15740491 未加载
c0m0over 7 years ago
For the people out there that&#x27;s not so into CS, and does not understands it&#x27;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 design.
评论 #15739273 未加载
评论 #15739186 未加载
esaymover 7 years ago
Perl is awesome. I bring in 90k+ a year making a living on perl while only working remotely ( and living in a small city where the avg household income is &lt;$50k year).<p>Honestly, the only reason python &quot;won&quot; was because google picked it up for internal use (and that was only because of the perl5&#x2F;6 debacle since why pick perl5 since 6 would be coming out by next Christmas?)<p>As far as &quot;undecidable&quot;, its a feature and one of the reasons why it still remains faster than most other dynamic scripting languages.
评论 #15741881 未加载
hpcjoeover 7 years ago
[not trying to hijack the discussion, but I think a meta-discussion is in order based on comments I&#x27;ve seen on this article]<p>The article is about whether or not you can actually parse Perl without running Perl to parse itself. One of the benefits&#x2F;drawbacks to Perl is that it lets you run the interpreter at compile time, thus resulting in the possibility of an infinite loop preventing compilation. Which makes some people unhappy.<p>Oddly enough, this reminds me of the whole strongly&#x2F;weakly typed discussion, with people weighing in and asserting one position or another, without really adequately comprehending the opposing position.<p>The meta-discussion here repeats almost every other discussion of Perl I see on HN and elsewhere. First there is a claim of death, either in the past, or present. Then there are claims that death was by sigil, line noise, etc. Further, additional claims are that other tools have taken over its space.<p>The data used as evidence are StackOverflow analyses, or Tiobe scores, or, insert additional popular, and often self-selected, data sets. You have to make specific assumptions about some of the data presented to be able to accept it, such that each community has about the same rate of people searching for answers on SO, or other places. Or that the searches will have relevant terms in the in each case.<p>This is a stretch to put it mildly. If I google for DBIx::Simple, and this search is caught by one of these filters, will it show up in Perl or not? I can&#x27;t actually answer this. I have to refer to what the collectors of the data say on their own methodology [1][2]. I am not saying that there are not secular changes throughout the industry, or that various observed gross trends are &quot;wrong&quot;. What I am saying is be careful reading into these analyses too strongly, as they may not be measuring what you think they are measuring.<p>In many cases, over the last 20 years or so, I&#x27;ve seen folks pushing Python happily talking up why they left or abhor Perl, usually saying&#x2F;quoting things they&#x27;ve heard. From my own experience, Perl 4 and onward, much of what they complain about was Perl 4 or before. Likely before many of them started programming. That is speculation on my part, but it does appear to fit what I&#x27;ve observed.<p>If I extend this out to operating systems, I have people tell me how horrible Linux is and how much better anything-other-than-linux is than it on a very regular basis. They like to list (what they perceive to be) the faults, quote SO and other random websites as examples, and often make pronouncements not backed up by objective fact ... in many cases contradicted by objective fact.<p>We as a society of technologists seem to like our tools to the point where we feel that we can and should break into tribes with tags of honor around our necks, and nasty comments about alternative tools, and users of said tools. I&#x27;ve personally heard many an anecdote and critique of various tools from otherwise smart technologists that were, at best, badly misinformed, and at worst ... not simply disingenuous, but dishonest.<p>Look, it is great you like your tools, your operating system, your language. It does not mean that you are &quot;better&quot; or &quot;smarter&quot; than someone else because you use such things. And yes, I&#x27;ve had professional discussions as recently as last week on exactly this issue. Which is insane.<p>Maybe I&#x27;ve spent too many years on the business side, as I look at all of these things as tools to accomplish a goal, and as engineers, our jobs are to select the right combination of tools to a) minimize effort, b) maximize the possibility of success, c) enable debugging, observability, supportability.<p>No single tool, OS, editor (yes, I went there) has this. Moreover, if you need to bash what someone else is using simply for self gratification, then there are deeper issues afoot than simply a technological consideration.<p>Finally, I&#x27;ve been a user of Perl, and contributor to (CPAN) for more 20 years. Rumors of its demise, are greatly exaggerated. It is not my be-all&#x2F;end-all language ... I am comfortable and competent in 5-6 at any one time, and can easily work in Python, C, Julia, Node, etc. w&#x2F;o major issue (though with google nearby for things I don&#x27;t have on the tip of my memory).<p>I don&#x27;t use Perl for machine learning (though I could). I don&#x27;t use it for numerics (though, again, I could). I don&#x27;t use node for either of these. You pick the right tool for the right job. And you need to keep an open mind throughout the process on what the right tool is.<p>If you feel a need to bash on others choices, it might be worth reflecting why you think this course of action actually adds any light to a discussion. From what I&#x27;ve seen, it only adds heat.<p>[1] <a href="http:&#x2F;&#x2F;blog.codeeval.com&#x2F;codeevalblog&#x2F;2016&#x2F;2&#x2F;2&#x2F;most-popular-coding-languages-of-2016" rel="nofollow">http:&#x2F;&#x2F;blog.codeeval.com&#x2F;codeevalblog&#x2F;2016&#x2F;2&#x2F;2&#x2F;most-popular-...</a><p>[2] <a href="https:&#x2F;&#x2F;stackoverflow.blog&#x2F;2017&#x2F;05&#x2F;09&#x2F;introducing-stack-overflow-trends&#x2F;" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.blog&#x2F;2017&#x2F;05&#x2F;09&#x2F;introducing-stack-over...</a><p>[edit: fixed ref spacing]
评论 #15739676 未加载
jerianasmithover 7 years ago
As far as undesirability is concerned, there are other languages, perl is not the only one. But it&#x27;s possible to write clean perl.
rurbanover 7 years ago
The same holds for every better dynamic language with compile-time evaluation. E.g. LISP with its reader macros. Even if LISP is trivially parsable, it still provides parse-time hooks which can lead to undecidability.<p>It&#x27;s a feature, not a problem.
chubotover 7 years ago
Related: <i>Parsing Bash is Undecideable</i><p><a href="http:&#x2F;&#x2F;www.oilshell.org&#x2F;blog&#x2F;2016&#x2F;10&#x2F;20.html" rel="nofollow">http:&#x2F;&#x2F;www.oilshell.org&#x2F;blog&#x2F;2016&#x2F;10&#x2F;20.html</a><p>Parsing POSIX shell is not undecideable, but bash adds a construct that relies on dynamic parsing, much like Perl.<p>(I cite this Perl article and the C++ one in this thread. And there is another one about parsing GNU Make.)<p>FWIW, Larry Wall has mentioned many times that Perl 6 fixes this problem. So he very much views it as a language design flaw. I don&#x27;t think you can argue that it&#x27;s not.<p>I watched 3 or more videos on Perl 6 and he&#x27;s mentioned it at least twice.
cutlerover 7 years ago
It&#x27;s almost 2 years since Perl 6 was released and it&#x27;s still dog slow at what Perl 5 was famous for - string parsing with regular expressions. A 19Mb Apache log file on my 2010 quad core Mac takes Perl 6 21 secs. to search for lines containing 15-character words compared with Ruby: 4secs, Perl 5: 2.4 secs. and PHP7: 0.8 secs. We keeping hearing how the optimisations are coming but I haven&#x27;t seen any significant improvements in string parsing since Perl 6 was released in December 2015. How can you market the advantages of a new version of a language when it can&#x27;t even match its predecessor?
评论 #15746502 未加载
jwilkover 7 years ago
It&#x27;s worse than that. You can&#x27;t parse Perl without running arbitrary Perl code:<p><a href="https:&#x2F;&#x2F;www.perlmonks.org&#x2F;?node_id=663504" rel="nofollow">https:&#x2F;&#x2F;www.perlmonks.org&#x2F;?node_id=663504</a>
评论 #15739348 未加载
评论 #15739221 未加载
grabcocqueover 7 years ago
You know there was that recent Stackoverflow analysis that concluded that Perl was the most disliked programming language?<p>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.
评论 #15739261 未加载
评论 #15739056 未加载
评论 #15739368 未加载
评论 #15738993 未加载
评论 #15739376 未加载
评论 #15739216 未加载
评论 #15739164 未加载
评论 #15739177 未加载
评论 #15739176 未加载