At 09:45 AM 8/5/00 -0700, Nathan Wiger wrote:
> > Probably not with tie, but with function calls in general, sure. We can do
> > some flow control analysis on the subs and propagate it outwards so we
> > might know, for example, that:
> >
> >    sub foo {
> >      my (@vars) = @_;
> >      return scalar @vars;
> >    }
> >
> > doesn't change its args or any globals, so can be safely optimized around
> > to some extent.
>
>I hate suggesting bad ideas (but I think this may be one), but has any
>thought been given to a "pre-compiler" ala Java?
>
>I know alot of thought is being given to a true compiler, but I'm not
>convinced this is feasible. Maybe a pre-compiler that could do some
>optimization and then dump the thing off as a ".bpl" (binary perl?)
>program. This would still have to be run through the interpreter, but
>would be much faster because of pre-optimization. The main difference
>between us and Java is that we wouldn't *have* to pre-compile, but only
>if speed was crucial (key CGI apps, for example). We already sort of
>have hooks for this ability with dump/undump.
>
>Granted, this is probably a really bad idea. Feel free to shoot it down
>(my feelings *won't* be hurt). :-)

This is a really good idea, honestly. One of The Plans is to be able to 
freeze the final bytecode that would be handed to the interpreter off to 
disk instead. Should (if we do our jobs right) allow for faster startup, 
and it should also let us do more aggressive optimizations than we do now. 
Not because this method lends itself to better optimizations (freezing 
parts of programs, like modules, actually hurts optimization some), but 
because we have more *time* to optimize.

I don't, for example, want to pay an extra 30 seconds on each program 
invocation to run the code through the optimizer. I would be perfectly 
happy to do so, though, if the resulting code is frozen to disk so I didn't 
pay it the next time.

                                        Dan

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

Reply via email to