ietf-mta-filters
[Top] [All Lists]

Re: "extensible" grammar

1998-01-23 17:34:48
On Wed, 21 Jan 1998, Rob Earhart wrote:
  Nope - you *can* do your semantic checking in your parser, even
under this scheme.  I'd argue that this makes your parser needlessly
complex and hard to maintain, when the work's better split up and done
at a higher level, but that's just my opinion.

Functional separation is good.  Layers are bad.  I've never been a fan of
multi-level grammars -- in my experience they make things less reliable
and harder to understand.  Every time you introduce a layer you partition
part of the problem into very complex cross-layer communication issues
(your if-then-else example is one case).  Even a layer as necessary and
delinated as TCP has these problems (think IP security, urgent data,
SIGPIPE).

Parsers are cheap -- I wrote a parser to convert an RFC from text to html
in C in a few days and that's full of ugly heuristic rules.  Even if we
have a single-level grammer and have each Sieve command designed by a
separate individual who's not communicating with others, Sieve will still
be an order of magnitude or two simpler. 

So I see this as a proposal to constrain the human readability of the
script for all time in order to save a few programmer hours.  This seems
like a really bad tradeoff to me.

If we want to compromise on this issue, I suggest we define the rules for
skipping a command (look for unquoted ";"), and let extensions which add
new control structures do whatever they wish.  New control structures will
be rare.  I also don't object to suggestions for what the syntax of
extensions should look like -- just don't make them recommendations or
requirements.

                - Chris


<Prev in Thread] Current Thread [Next in Thread>