develooper Front page | perl.perl5.porters | Postings from June 2018

On refactoring B::Deparse

Thread Next
From:
Rocky Bernstein
Date:
June 8, 2018 18:06
Subject:
On refactoring B::Deparse
Message ID:
CANCp2gafbwXeqe91mdoEUPqqrvjhB1r6+qQeCp1Ja4rOQydNKA@mail.gmail.com
I will be giving a talk at the upcoming YAPC 2018 in Glasgow on
B::DeparseTree and its use in stack traces and in the Devel::Trepan. As a
result, I have been completely refactoring the code that I started in 2015.

However I now see that this refactoring is also valid as a way to refactor
B::Deparse. So I bring this to p5p developers attention in case there's any
interest in contributing to this as a possible future replacement to
B::Deparse.
Or if there are developers who want to "backport"  ideas from
B::DeparseTree into B::Deparse.

In my biased opinion, B::DeparseTree is more fun to work on. Some effort
was put into making it more debugable and developer friendly.

B:DeparseTree could also be used as a stepping stone to provide an AST as
suggested by chromatic in
http://www.modernperlbooks.com/mt/2012/09/why-perl-5-needs-an-ast.html#comments

Finally, B::DeparseTree might provide a better framework for providing more
reliable and extensive kinds of Perl syntax reformatting: in its parallel
tree it can store higher level Perl syntax information gleaned from lower
levels in the tree. One small example includes whether an expression needed
parenthesis for precedence.

The refactoring is probably only 2/3rds done and B::DeparseTree has long
way to go to get up to the level of accuracy that B::Deparse currently has.
There is plenty of work still to be done. So again, I hope others will help
out.

For more information, I have written about my experiences so far in
http://blogs.perl.org/users/rockyb/2018/06/introducing-bdeparsetree-and-rewriting-bdeparse-part-1.html
or see
https://metacpan.org/pod/distribution/B-DeparseTree/lib/B/DeparseTree.pod

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About