At 10:25 AM 3/29/2001 -0500, James Mastros wrote:
>On Wed, Mar 28, 2001 at 03:41:42PM -0800, Hong Zhang wrote:
> > Are we over-optimizing? The Perl is just an interpreter language.
> > Who really needs this kind of optimization for Perl? Even C does
> > not provide this feature.
>Umm, art thou sure?  C can optimize better then we currently do many times,
>because it doesn't have to worry about side-efects as often because it
>doesn't have the concept of ties/overriden operators.  (It does, and we do,
>have to worry about aliasing, but that is somthing of a smaller problem.)

Aliasing is actually one of the bigger problems with C, or so I'm lead to 
believe. It gets in the way of a number of optimizations rather badly. (So 
say some of Compaq's C and Fortran compiler folks, and I have no reason to 
doubt them. The Fortran compiler often generates faster code than the C 
compiler for this reason apparently)

>Just because C doesn't memonize, doesn't mean we shouldn't have that
>optimization available to us.  So many other optimizations that are doable
>in C aren't in perl.

That's not true. Perl's probably more optimizable than C for many things.

> > Though Pascal/Ada have distinctions
> > like function/procedure, it does not make them any faster than C.
>Umm, I don't know Ada, but in Pascal, the only difference is that one
>returns a value and the other does not (IE like void vs. nonvoid functions
>in C, or sub vs. function in VB).

Well, functions without return values are mildly faster than functions with 
return values. No stack and/or register manipulation needed for the return.


                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to