At 02:38 PM 7/6/2001 -0500, David L. Nicol wrote:
>Dan Sugalski wrote:
> >
> > At 01:59 PM 7/6/2001 -0500, David L. Nicol wrote:
> > in-code pragmata instead of compiler switches?
> >
> > Lexically scoped optimization hints seem like rather a tricky thing to deal
> > with.
>
>I know I'm naive but here's how I see it:
>
>         ->  we design a linkage standard that is the same
>             at all optimization levels.

If we can avoid this to some extent (At least making it transparent to some 
extent) it'd actually be a good thing. Perl has the advantage in some ways 
of presenting close to all the source to the compiler at once, which lets 
you do cross-module optimization, peeking, analysis, and general mucking 
about that you can't do when you link against shared libraries.

Of course, we're going the shared library route for modules too, which sort 
of shoots that down, but... Hopefully we can have a lot of info about sub 
return values, input parameters, and side effects stored for the optimizer 
to make rational decisions with.

>         ->  How far to optimize anything is set with flags.
>
>         ->  Compilation occurs by block, innermost first, as
>             far as is possible (but no farther, until Godot arrives.)
>
>Optimization flags set things that can be done in advance, checks to skip
>and so forth.
>
>With this mind set, Lexically scoped optmization is the only way to
>go, and maintain current flexibility.  What if my symref-free code wants
>to use a module that uses symrefs?  With a --promise command line switch,
>the module would need to override it or break, which gives us LSO the other
>way.

I think we'll have to warn if a module gets used that breaks an assumption 
the compiler's been told it can make. I know that you can convince Compaq C 
to generate bad code if you tell it to assume things that are flat-out not 
true, and I bet that gcc (and all other compilers, I expect) are the same way.

>What am I missing, I wonder?  That the block structure goes away?

No, that a lot of optimizations are sort of global, especially with perl 
which has a rather large global presence.

                                        Dan

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

Reply via email to