develooper Front page | perl.perl6.internals | Postings from November 2004

Re: Continuations, basic blocks, loops and register allocation

Thread Previous | Thread Next
From:
Larry Wall
Date:
November 15, 2004 09:16
Subject:
Re: Continuations, basic blocks, loops and register allocation
Message ID:
20041115171640.GA20193@wall.org
On Mon, Nov 15, 2004 at 09:51:58AM +0100, Leopold Toetsch wrote:
: Yes, as said I'm fine too with that. Perl/Python will do that anyway.
: But what about other languages? Are we forcing these to be as dynamic as
: the primary HLL targets?

In Perl 6, any assumptions that cause inefficiency should be optional.
An explicit pragma should be able to turn off such assumptions in
either a lexical scope or the application as a whole.  Then if some
code needs the inefficiency for correct operation, it can turn it
back on in a more limited scope.  That's where we're headed with
class finalization semantics, and it'd be nice if other optimizations
were also possible based on a negotiation between the code that
needs the speed and the code that needs the semantics.

In the case of Perl, most code is not going to want to do hanky-panky
with the caller's lexicals, and should not be punished for the crimes
of the few bits of code that do.  I do not mind forcing the rare
code to use extra declarations so that the common code runs fast.
For instance, I suppose that lexical rebinding code could be forced
into predeclared subroutines rather than MMD or SD, so we can know
at compilation time whether a call does funny things with $CALLER::_
and such.  (In any event, no code is allowed to mess with the names in
the caller's lexical symbol table unless the caller's code is in the
process of being compiled.)  Or maybe we can special-case $CALLER::_
without a pessimal generalization to $CALLER::foo.

It'd be nice if stock Perl 6 ran blazingly with perfectly consistent
and flexible semantics, but it's also important to have a knob you
can turn up that says "Damn the torpedoes, full speed ahead!"

So if you're going to assume anything, assume that all your assumptions
are negotiable.  :-)

Larry

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About