Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

S6Q: When will the perl6 parser be documented?

5 views
Skip to first unread message

Austin Hastings

unread,
Apr 13, 2003, 3:53:22 PM4/13/03
to perl6-l...@perl.org
Given the specification of macros as taking a "context" argument:

macro foo is parsed(/somehow/) {...}

this implies that there will be a published, documented list of
contexts which macros will attach themselves to.

That, plus the "you can do anything" mentality of Perl, means that
there are really going to be at least two lists of rules in the P6
grammar: "those we're sticking to", and "those we're not" -- the needs
of the parser-coders to have some flexibility in
changing/rewriting/adding/deleting rules being balanced against the
ravening hordes of lisp|m4|.roff|C-preprocessor macro-freaks waiting to
totally recode the language using this new power. (For good -- always
for good.)

So, what's the scheme? Two parts? (constant, not) Three parts? (Sacred,
protected, victim) More?

Also, what's the release scheme? Will there be separate releases of the
language-spec (aka grammar) and the language? Or will there be a
threshold beyond which a major/minor release is called for?

Perl 6.0.0.0 -> 6.0.0.1 if only "victim" parser changes
Perl 6.0.0.0 -> 6.0.1.0 if "protected" parser changes
Perl 6.0.0.0 -> 6.1.0.0 if "sacred" parser changes

Presuming that the grammar will be versioned, regardless of the scheme,
will I be able to say:

#! /usr/bin/perl6.1
use Perl6::Grammar v6.0.0.2;

?

=Austin

Larry Wall

unread,
Apr 14, 2003, 3:04:52 PM4/14/03
to perl6-l...@perl.org
First, to answer the question posed in the subject line but not
in the body, the parser will be documented whenever Apocalypse 18
comes out. :-)

On Sun, Apr 13, 2003 at 12:53:22PM -0700, Austin Hastings wrote:
: Given the specification of macros as taking a "context" argument:


:
: macro foo is parsed(/somehow/) {...}
:
: this implies that there will be a published, documented list of
: contexts which macros will attach themselves to.

There's really only one context, provided by the current lexical scope.
Macros and such are forbidden to change any scope they have not be
declared in or imported into. The current grammar is always provided
by the lexical scope. How close or distant that is to the grammar
that you start out with at the top is a function of how many tweaks
have happened between there and here.

: That, plus the "you can do anything" mentality of Perl, means that


: there are really going to be at least two lists of rules in the P6
: grammar: "those we're sticking to", and "those we're not" -- the needs
: of the parser-coders to have some flexibility in
: changing/rewriting/adding/deleting rules being balanced against the
: ravening hordes of lisp|m4|.roff|C-preprocessor macro-freaks waiting to
: totally recode the language using this new power. (For good -- always
: for good.)
:
: So, what's the scheme? Two parts? (constant, not) Three parts? (Sacred,
: protected, victim) More?

There is only one list, which is the list of rules the program starts
with, any of which are fair game: "All is fair if you predeclare."

I don't think we can be in the business of predicting which rules might
or might not change in future versions.

: Also, what's the release scheme? Will there be separate releases of the


: language-spec (aka grammar) and the language? Or will there be a
: threshold beyond which a major/minor release is called for?
:
: Perl 6.0.0.0 -> 6.0.0.1 if only "victim" parser changes
: Perl 6.0.0.0 -> 6.0.1.0 if "protected" parser changes
: Perl 6.0.0.0 -> 6.1.0.0 if "sacred" parser changes

How violent a particular change to the standard grammar might be can
really only be analyzed when we get there. Take two ends of the spectrum.

On the one end, nobody writes any grammar tweaks. We can change any
rule in the next version and no one is the wiser.

On the other end, everyone writes grammar tweaks. We can't change
any rule without breaking every program on the planet.

The truth will be somewhere in the middle, and for any particular rule,
the truth will depend on how many tweaks there are in *current* use for
it. We could put together a list of "sacred" rules, but if Inline::APL
tweaks one of them, and then Inline::APL becomes inexplicably popular,
we didn't really have a very sacred rule in the first place. Don't make
threats you aren't willing to carry out.

: Presuming that the grammar will be versioned, regardless of the scheme,


: will I be able to say:
:
: #! /usr/bin/perl6.1
: use Perl6::Grammar v6.0.0.2;
:
: ?

We're allowing multiple versions of all the other modules and classes,
so I don't see why grammars should specifically disallow it.

Larry

0 new messages