Grant Proposal: RPerl Medium-Magic Grammar
Sat, 19-Sep-2015 by
Makoto Nozaki
edit post
_We have received the following grant application "**RPerl Medium-Magic Grammar**". Please leave feedback in the comments field by September 27th, 2015. If your comment does not appear in 24 hours, contact me at tpf-grants-secretary at perl-foundation.org. As we have four proposals on RPerl this time, please use [RPerl User Documentation proposal](http://news.perlfoundation.org/2015/09/grant-proposal-rperl-user-docu.html) if your comment is about RPerl in general and not specific to this proposal._
* * *
# RPerl Medium-Magic Grammar
- Name:
Paul Bennett
- Amount Requested:
USD 1,200
## Synopsis
RPerl currently supports a low-magic subset of the Perl 5 programming language.
I request funds to implement an updated RPerl grammar for a medium-magic subset of Perl 5, which will have significantly fewer restrictions than the current low-magic RPerl grammar.
## Benefits to the Perl Community
A medium-magic grammar will allow many normal Perl programs to benefit from the speed of RPerl, and is the next step toward a high-magic version of RPerl in the future, which will eventually be an optimized, fully-compatible drop-in replacement for the current Perl 5 core.
## Deliverables
1\. GrammarMedium.eyp EBNF grammar file
2\. A description of the medium-magic RPerl grammar
3\. New unit test cases using the same mechanism as existing tests
## Project Details
The low-magic RPerl grammar already exists:
https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Grammar.eyp
A large number of test files already exist for the low-magic RPerl grammar:
https://github.com/wbraswell/rperl/tree/master/lib/RPerl/Test
The above test files are tested for compliance with the low-magic RPerl grammar by being parsed via the following test driver:
https://github.com/wbraswell/rperl/blob/master/t/10\_parse.t
The medium-magic RPerl grammar will involve significant updates to all 3 of the above components.
This grant proposal covers the grammar built using the CPAN distribution named Parse::Eyapp, which includes both lexical analysis (lexer AKA tokenizer) and syntax analysis (parser), the output of which is an RPerl abstract syntax tree (AST).
After the work of this grant proposal is completed, then the next steps are to begin implementing the C++ code generator and other semantic actions, in order to transform the AST into optimized, high-speed executable code.
## Inch-stones
1a. Copy low-magic Grammar.eyp to GrammarMedium.eyp
1b. Update lexical token types
1c. Update CompileUnit productions
1d. Update Program productions
1e. Update Module productions
1f. Update Subroutine productions
1g. Update Class productions
1h. Update Method productions
1i. Update Operator productions
1j. Update Loop productions
1k. Update Conditional productions
1l. Update Variable productions
1m. Update Array productions
1n. Update Hash productions
2a. Describe lexical token types
2b. Describe all grammar rules and productions
3a. Create new unit test files in Test/ for all updates in step 1 above
3b. Create 1 new test driver script in t/ to handle all unit test files
## Project Schedule
Work may begin at any time, and will take about 60 to 90 days.
## Completeness Criteria
A medium-magic version of RPerl will be officially released by the RPerl team.
## Bio
I am working directly with Will Braswell, the RPerl head programmer.
I have experience writing EBNF grammar code for the Perl 5 language in my recent work with Doxygen and Marpa.
https://metacpan.org/release/Grammar-Marpa
I am a professional Perl 5 programmer.
I currently maintain 5 CPAN distributions:
https://metacpan.org/author/PWBENNETT
Comments (7)
Great project to the health of perl.
I've been reading up on RPerl for some days now, and mailing with Will Braswell, mostly about the documentation and examples. Last YAPC::NA in Salt lake City, I got a demo of what he was doing.
If, thanks to this grant, RPerl can handle more "magically" aspects of Perl 5, I do hope it will draw attention from the core developers of Perl 5. Making Perl 5 faster is a nice prospect. For me, I look forward to the prospect of using such techniques for Perl 6.
I think this proposal is promising and I hope TPF will fulfill this grant.
vote for!
The only thing lacking for RPerl is support for more grammer, I vote for this.
I support this proposal since this grant is a bellwether if RPerl can be developed and maintained by the perl community at large vs one developer who for personal reasons can stop development at any time and leave users hanging with fantastical what ifs. If this grant is approved and successfully completed, it opens the door to more RPerl grants in the future and proves RPerl has a viable development culture.
vote for!
On behalf of Paul Bennett and myself, we thank you all for your support, and we thank TPF for their consideration in awarding this grant.
Ms. van Dijk is correct, this will be a big step for RPerl toward supporting the more "magically" complex parts of Perl, and thus will drive adoption of RPerl within the greater Perl community as a whole.
The "anon" comment is also correct, this grant will help prove there is a sustainable team of multiple Perl experts working on the RPerl project.
So, let's get coding! :-)