Overall, I think Marpa should be presented as mature, modern, and immensely powerful.
The web site should be aimed at beginners, with clear indications as to where experts
can go for more details.
Any examples should be complete, use modern Perl constructs, and have error checking.
I'm not advocating Modern::Perl, just high quality.
Having an example on the front page surprised me at first, but it's grown on me. I
would like to see a few notes - for beginners - pointing out some perhaps unexpected
constructs. See below.
Now, the new web site.
1) The page title and heading
Marpa: The foundation of modern, grammar-based, parsers
o It has 'Marpa' in the title and heading. Think Google-type searching.
o Since 'foundation stone' is almost a tautology, I chose not to use 'stone'.
o 'Foundation' indicates where we think Mapra belongs in any suite of parsing code.
o 'The foundation' is bold and actually quite a strong statement. It suggests superiority in that
other parsers don't measure up as candidates for a foundation.
o 'Modern' indicates - but does not prove - that Marpa is new and different.
o 'Grammar-based' makes clear the claim is not to literally parse everything, but to parse
the vast array of stuff for which a grammar can be devised.
2) The example
o Add a sub-heading, perhaps at h2 level.
Try: Here's a complete parser for simple arithmetic expressions.
o Add:
use strict;
use warnings;
Never encourage beginners to write tacky code. Let other people drop such protections, but don't let
them see us doing it.
o Add Try::Tiny or something. See below.
o EOG => END_OF_GRAMMAR makes it much clearer.
The abbreviation is simply unnecessary. Let others do that. Provide clean, firm, guidelines for
attaining quality.
Likewise for 'Expr', etc.
o || Expr '*' Expr action => do_multiply # Note 1, 2.
Add notes. Here we could say:
Note 1: The '||' indicates alternative ways of constructing an expression.
Note 2: do_multiply is a function Marpa will call automatically when this alternative of the 'Expr'
rule fires.
o my $value_ref = $grammar->parse( \'7 + 42 * 1', 'Calc' ); # Notes 3, 4.
Note 3: Marpa uses a reference here in order to avoid copying what could potentially
be a huge string.
Note 4: A great deal of error checking is built-in to Marpa. Here, if there is no parse,
or if the parse is ambiguous, parse() throws an exception. Hence Try::Tiny.
o printf("$$value_ref\n") => print "$$value_ref\n";
Add ';'. Simplify.
And move this (and => 49) above the subs.
3) The footers Fast, Expressive, Flexible
They are good.
Add something about accepting utf8 in the grammar and in the input stream.