Message from discussion Blocks, continuations and eval()
Mailing-List: contact perl6-language-h...@perl.org; run by ezmlm
Delivered-To: mailing list perl6-langu...@perl.org
Received: (qmail 23781 invoked from network); 22 Apr 2005 16:33:15 -0000
Received: from x1a.develooper.com (HELO x1.develooper.com) (22.214.171.124)
by lists.develooper.com with SMTP; 22 Apr 2005 16:33:15 -0000
Received: (qmail 8571 invoked by uid 225); 22 Apr 2005 16:33:14 -0000
Received: (qmail 8567 invoked by alias); 22 Apr 2005 16:33:14 -0000
X-Spam-Status: No, hits=-2.6 required=8.0
Received-SPF: neutral (x1.develooper.com: local policy)
Received: from ylpvm43-ext.prodigy.net (HELO ylpvm43.prodigy.net) (126.96.36.199)
by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 22 Apr 2005 09:33:05 -0700
Received: from pimout2-ext.prodigy.net (pimout2-ext.prodigy.net [188.8.131.52])
by ylpvm43.prodigy.net (8.12.10 outbound/8.12.10) with ESMTP id j3MGX4lA016408
for <perl6-langu...@perl.org>; Fri, 22 Apr 2005 12:33:04 -0400
Received: from wall.org (adsl-64-160-46-45.dsl.snfc21.pacbell.net [184.108.40.206])
by pimout2-ext.prodigy.net (8.12.10 milter /8.12.10) with ESMTP id j3MGWuSX398538;
Fri, 22 Apr 2005 12:32:56 -0400
Received: from london.wall.org (localhost.localdomain [127.0.0.1])
by wall.org (8.13.1/8.12.11) with ESMTP id j3MGWtwr010769;
Fri, 22 Apr 2005 09:32:55 -0700
Received: (from larry@localhost)
by london.wall.org (8.13.1/8.13.1/Submit) id j3MGWtZI010768;
Fri, 22 Apr 2005 09:32:55 -0700
Date: Fri, 22 Apr 2005 09:32:55 -0700
Subject: Re: Blocks, continuations and eval()
Mail-Followup-To: perl6-langu...@perl.org, s...@payrard.net
References: <20050408140311.GD21475@sci.fi> <firstname.lastname@example.org> <20050408164140.GF21475@sci.fi> <m264ys5lkd....@obelisk.bofh.org.uk> <20050412111756.GB6...@wall.org> <20050421133007.GA13...@sci.fi> <20050421153628.GA3...@wall.org> <1103_1114099...@nntp.perl.org> <20050422111535.GC15...@stefp.dyndns.org>
Content-Type: text/plain; charset=iso-8859-1
From: la...@wall.org (Larry Wall)
On Fri, Apr 22, 2005 at 01:15:35PM +0200, Stéphane Payrard wrote:
: I am making a presentation about Perl6 this week end. My point will
: be: the next generation of applicative languages will be scripting
: languages because they have come of age.
: Alternatives don't cut it anymore. Indeed C and C++ are memory
: allocation nightmare; Java and C# don't have read-eval loop, a
: necessary condition for rapid learning and development. Functional
: languages like haskell or ocaml are very powerful but needs massive
: wetware reconfiguration to get used to the syntax and semantic.
: So I will make do a presentation of Perl6 and Parrot features to make
: my point about upcoming scripting languages.
: I have a few questions inspired by my recently acquired knowledge
: about functional languages. Perl6 being the ultimate syncretist
: language, I wonder if some functional features will make it
: into Perl6. I know we already got currying.
A lot of features are making it into Perl 6 that have historically been
associated with "functional" programming. Off the top of my head:
 pattern matching arguments
: A very nice feature of Haskell and *ml is the possibility to define
: complex datastructures types and the control flow that manipulate
: these structures: constructors and pattern matching. With these
: languages, in a very deep sense, control flow is pattern matching. Can
: we expect Perl6 to propose something similar?
We don't (yet) have a full unification engine, though Luke has thought
about that some. But it probably wouldn't be the default in any case.
MMD and  matching is about as much as normal people can take in.
And of course, we let people derive from the Perl grammar itself, and
define macros based on parse rules, which is at least compile-time
pattern matching. (Though we discourage use of backtracking parsers
for dwimmery; the standard Perl parser will use backtracking only to
produce more meaningful error messages.)
: If yes, could be the matching part folded into the rule syntax? Rules
: are about identifying "structures" in parsed strings and acting
: accordingly. Partern matching is about identify typed structures and
: acting accordingly. There is a similarity there. Also we may want to
: match both at the structural level and at the string level. Or is
: this asking too much of rules, that have already swallowed both lexing
: and parsing.
Perl 6 rules are a new language, and that language can be extended
in various ways. Structural matching is one of those things that,
while we aren't worrying about getting it into Standard Perl 6,
we want to make sure it's possible to extend the mechanism in that
direction. Though we've already said that you can match against
an array, and recognize element boundaries with <,>, so we're most
of the way there by some reckoning. If the matcher is cognizent
of array element boundaries, it's also cognizant of array elements,
and a subrule could presumably be taught to dive down into one of
: The notion of data type become very useful in Perl6 for people who
: want it. In fact, Perl6 is a mix of dynamic and static types
: (bindings). I think type theory handles type inference in this kind
: of langage with something called dependant type. Though I have to go
: thru ATTaPl to get it.
I'm not famaliar with that usage, but then, I haven't studied type
inferencing in any kind of depth.
: Perl, like many scripting language is very lax and, when needed,
: converts implicitely values within expressions. This is nice, but I
: think that makes type inference impossible. Type inference is good
: because it allows to generate very efficient/strict code with very
: little type annotations.
Well, we hope to get some of those benefits from our optional type system.
: Can we expect in a distance feature a pragmatic mode convention to
: control automatic type conversions if any and the type inference
: scheme chosen when/if implemented?
If we design things right, I don't see how we can prevent it. :-)
My only requirement is that each file starts at the top in Standard
Perl and mutates into your language of choice by explicit lexically
Hmm, when you said "pragmatic modes", it occurred to me that I would
have difficulty calling "use ML" a mere pragma, since pragmas are
supposed to be about pragmatics, not syntax or semantics. I suppose
if we wanted to ignore Greek entirely we could call a syntax mutator
a synta and a semantics mutator a semanta, though of course these
categories shade into each other, and something like "use Python"
is going to have issues at all three levels. I don't know how much
benefit there is to trying to keep these linguistic levels straight,
except that we should probably reserve the actual language names
for complete emulation, and use names like "Javalike" or "Lispish"
for lesser mutations.
But anyway, the historic usage of "pragma" in CS is for hints to the
compiler that don't actually affect the meaning of the program, just
its implementation. It's almost certainly my fault, but I think the
Perl community as a whole has taken the term in a different direction,
and I'm not sure that we're making a meaningful distinction with
it anymore, other than to mean that a module name happens to be
spelled with a lowercase letter. I regret the loss of a good word,
and wonder if there's any way to also repair that damage, as long as
we're scheduling a revolution. Maybe it doesn't matter.