Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Slow evolution of Perl = Perl is a closed Word (use)

by tye (Sage)
on Sep 01, 2007 at 06:20 UTC ( [id://636485]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Slow evolution of Perl = Perl is a closed Word (use)
in thread Slow evolution of Perl = Perl is a closed Word

Of course there are other issues besides source filters. If you read the PPI documentation (really, go ahead, do it now, just the first part, not the really gory details; I'll wait right here in front of the comma until you come back), it covers this fairly well though briefly, even linking to "our own" On Parsing Perl.

Yes, even the non-source-filter issues can impact correctly parsing to the point of doing static analysis correctly.

With the size of CPAN, that's a pretty good indicator that a PPI-based approach would be very effective for use in an IDE.

Um. Maybe. PPI doesn't fail when trying to parse most of CPAN (that is, it doesn't notice that it has parsed something incorrectly to the point that it throws up its hands and declares that it can't go on). I have yet to see any claims as to how accurately or even completely PPI's parsing of all of CPAN actually is.

I wouldn't be surprised to find that many people only rarely run into problems with PPI's parsing of the code that they usually deal with. In fact, if someone is burdened1 by the use of syntax highlighting when editting their Perl code, then their coding style will be somewhat skewed such that they avoid even reasonable constructs if they happen to confuse their syntax highlighter. So I wouldn't be surprised if they also avoid some things that would trip up PPI. If their syntax highlighter actually uses PPI (such as if they were to use a PPI-based IDE for editting their Perl code), then surely their style will be skewed toward things that PPI gets right.

1 Is that the right word? I can't find my thesaurus.

My impression is that PPI, in practice, is good enough often enough that a PPI-based IDE could be successful if used on a new project (due to the feedback loop I noted above). The effectiveness of a PPI-based IDE when applied to an existing code base is certainly less certain, IMHO.

- tye        

Replies are listed 'Best First'.
Re^5: Slow evolution of Perl = Perl is a closed Word (use)
by erroneousBollock (Curate) on Sep 01, 2007 at 06:38 UTC
    W.r.t static analysis of perl, there would then seem to be a lot of things that would need to be sorted out (or at least heuristics provided for) to make it useful for the purposes of an IDE.

    In fact, if someone is burdened1 by the use of syntax highlighting when editting their Perl code, then their coding style will be somewhat skewed such that they avoid even reasonable constructs if they happen to confuse their syntax highlighter.
    Heh :-) I do use syntax-highlighting wherever possible, if only because it allows me (in my perception) to skim my code faster.

    I mostly use Vim (I've been trying to use Emacs of late)... it has lots of problems with its very simplistic highlighter. I don't avoid the "problematic" constructs; I've just formed a habit of inserting comments to "correct" those mistakes ;)

    My impression is that PPI, in practice, is good enough often enough that a PPI-based IDE could be successful if used on a new project (due to the feedback loop I noted above). The effectiveness of a PPI-based IDE when applied to an existing code base is certainly less certain, IMHO.
    Well, it has to start somewhere (assuming that making perl "more available" to beginners/infidels is a worthwhile goal).

    I agree that the feedback loop would eventually lead to a parser that works reasonably for arbitrary perl5 code.

    -David.

      I agree that the feedback loop would eventually lead to a parser that works reasonably for arbitrary perl5 code.
      I think you misunderstood. The feedback loop I see tye talking about is that programmers using syntax highlighting will tend to not use constructs the highlighter gets wrong, thus making the highlighting of the growing codebase closer and closer to perfect. That's the opposite of "arbitrary" perl5 code.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://636485]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-03-19 10:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found