develooper Front page | perl.perl6.internals | Postings from August 2001

Re: sub --> macro optimization

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
August 5, 2001 10:57
Subject:
Re: sub --> macro optimization
Message ID:
5.1.0.14.0.20010805134148.022402c8@tuatha.sidhe.org
At 09:32 AM 8/4/2001 +0200, Arthur Bergman wrote:
>01-08-03 20.43, skrev David L. Nicol på david@kasey.umkc.edu följande:
>
> > Instead of introducing a new keyword, have any sub consisting of
> > only one expression get replaced in the op tree with that expression,
> > instead of a subroutine-calling mechanism.  Complex in-place-expandables
> > could be implemented with
>
>Or write a decent optimizer.

The optimizer's not guaranteed to get that decent. That's the trouble with 
languages as dynamic as perl--you find yourself unable to safely do a lot 
of stuff without extensive analysis, and you may still find you can't be 
sure that it's safe.

One quick "*foo = $bar", where $bar's a sub ref, whacks any sort of 
optimization you might do with inlining foo. Do it symbolically and it 
shoots down *all* inlining, since you can't be sure what was altered.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


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