Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Is Devel::Declare really so much less evil than source filters?

The short answer is "not really, they are still quite evil".

Source filters are fragile because they have to parse Perl (as you said), Devel::Declare sidesteps this by using Perl's own parser. But this is just one of the reasons that source filters are fragile. Extracting the new syntax from the Perl code is just one step in the process, you then have to parse it into a usable form and generate code from it. These steps are still present in Devel::Declare and are by no means trivial or simple steps, especially given that your generated code must then be injected back into the parse stream of an existing document.

Now, that said, if Perl had a good set of Parser/AST/Code-gen libraries, then I think my response would be "yes, they are *much* less evil".

As for the question of "Too Much Magic", well, this is true, but being made less and less true as the Devel::Declare team petitions p5p to get some of their hooks made official APIs. How far that will go, we will have to wait and see.

Great module for try/catch sugar in perl. I love pairing it with Moose::Util::TypeConstraints to have type based exception handling. Make sure that you have the latest Devel::Declare or you can have some weird issues that won't seem to make any sense.
The last sentence seems to suggest that it's not robust, or at least it was not. Still the question remains if it's a conceptional fault, or merely a lacking implementation right now.

I wouldn't put too much stock into CPAN ratings, they are sometimes really insightful and useful, and other times are the rantings of lunatics with little or no understanding of the issue. In this case I suspect that the comment speaks less to the overall fragility of Devel::Declare, and more to the fact that Devel::Declare is still a new module and still needs to have all its bugs worked out.

-stvn

In reply to Re: Is Devel::Declare really so much less evil than source filters? by stvn
in thread Is Devel::Declare really so much less evil than source filters? by moritz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-03-29 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found