I (impersonally) believe that hyper context is the right solution to
this because context can propagate to where it needs to dynamically.
As for the fact that it's not the default list context for "for",
that could easily be changed with a pragma.  Maybe that could even
be the default someday, but we have to educate people to think about
"hyper" first.

As for the other part of the proposal, a parallel smartmatch would
need new comb syntax for the compound pattern--I wouldn't overload
given/when for that.  Or maybe just make a way to attach a mapreduce
action to any leg of a junction or hyperoperator.  In any case, we need
to make sure it's easy to place such a parallel comb of matchers at the
pointy end of a feed, and if the source of the feed is also executing
in parallel, make sure the feed can be optimized to a full crossbar
based on packet destination.  (And just as in the case of optimizing
given/when to a jump table, this also implies that smartmatching must
be assymetrical, not symmetrical.  It's just the "jump" in this case
is a packet routing rather than program counter routing.)

It's also possible that we should discourage syntactic parallel
matching in favor of parallel polymorphic dispatch, given that
signatures can also express patterns.  Might need to tweak the current
multiple dispatch rules a bit though if we want dispatch ambiguity
to express nondeterminism.  In any case, real mapreduce situations
are often generated dynamically, and cannot easily be expressed in
a syntactically fixed set of options.

And overriding all of this is how to hide all this cool stuff so
that it A) doesn't drive newbies mad, but B) is right there at their
fingertips when they need it, and C) is easily recognizable as magic
so that when they see it in other people's code they'll understand that
they don't understand.  That's why hyper context is an explicit feature
in standard Perl 6.  But then, so is the ability to add a pragma like:

    use hyper;

It's really, really easy to misdesign a computer language by
overemphasizing one particular design dimension to the detriment
of others.  With Perl 6 we're trying to make the opposite mistake.

Larry

Reply via email to