Front page | perl.perl6.language |
Postings from November 2001
Re: flex perl mess
From: Larry Wall
November 7, 2001 16:49
Re: flex perl mess
Message ID: 200111080045.QAA18251@wall.org
Sam Vilain writes:
: On Wed, 7 Nov 2001 12:26:31 +0000
: Sam Vilain <email@example.com> wrote:
: > Why limit Perl to OO and procedural programming at its core?
: I just realised my mistake after looking at the hyperoperator discussion:
: Hyperoperators bring functional programming to Perl, with all of the mad
: but inspired programming nuttiness that comes with functional programmers.
I don't think hyperoperators have much to do with functional programming.
Funtional programming has more to do with closures, which we already
have, and writing code without side effects, which we can already do.
Hyperoperators and curried parameters are mostly just syntactic relief.
: So if functional programming can be in Perl 6, why not rules based
Perl already supports a limited form of rules-based programming within
regular expressions. General rule-based programming depends on
backtracking through ordinary code, which, as I mentioned in A3, has
interesting implications with regard to scoping, which might be
resolved if we allow continuations.
But yacc is a different sort of beast, in that it is analyzing a static
set of rules to produce a one-pass LALR(1) algorithm without
backtracking. As such, it's just a convenient data structure that gets
turned into a different internal data structure that gets interpreted.
Something like that can be done with the operator definition capability
we'll have in Perl 6.
It's still possible we'll end up with a yacc approach for parsing Perl 6,
but I expect rather that the backtracking rules of regular expressions
will suffice to parse, as long as we can tie various regexes together
into a system that allows for the creation of recursive data structures.
The real trick will be integrating operator precedence without excessive