Building advanced tools like a static analyzer is much harder / partly impossible because you can't parse it without running it.
Re:Perl Cannot Be Parsed: A Formal Proof (2008)
by sgrove on Sunday June 14, 2015 @11:18AM
(#9715163)
Abstract interpretation/symbolic execution should still work, but it would require basically reimplementing the semantics of perl, yes.
Re:Perl Cannot Be Parsed: A Formal Proof (2008)
by Someone on Sunday June 14, 2015 @03:09PM
(#9715995)
That still may be of little help in, say, a perl IDE, as the meaning of a program _can_ depend on the input it reads.
"But that will not happen in practice"
If you think that to be the case, use a language that _can_ be parsed. That makes life easier for implementers of IDE's, refactoring tools, etc. and costs you nothing (given the "that will not happen in practice" claim)
Take a look at PPI - Parse, Analyze and Manipulate Perl (without perl) module: https://metacpan.org/pod/PPI
Infact it says: "only Perl can parse Perl".
On the other hand JavaScript has esprima that is written in JavaScript, and also other languages like Python can parse themselfs.
As a Perl programmer, I don't know if it is a pro or a cons. For example Perl::Critic cannot parse some costructs, cause they are too complicated. What I usually do, as in many other contexts, I try to understand what is the subset of features I need to use.
The first comment.