At 12:51 PM 7/6/2001 -0500, David L. Nicol wrote:
>Benjamin Stuhl wrote:
>
> > (eg. I solemnly swear to never use symbolic
> > references, count on specific op patterns, or
> > use any number large enough to require
> > bignums.)
>
>These are things (aside from the number limit, but overflow catching
>is needed anyhow, so switching to bignums instead of crashing and
>burning seems like a reasonable default behavior) that could be
>easily identified and flagged (well, use of symbolic reference) at
>first-pass time.
>
>Except for
>
>
> ${$thing}
>
>if we don't know if $thing is a reference or a name -- but can that
>be figured out on first-pass?
No. Unfortunately not, at least not without a *lot* of analysis, far more
than is likely to be worthwhile. This:
$thing = bar();
${$thing};
shoots it down pretty hard. (While we'll be doing interprocedural analysis,
I think, doing it on the level that'd be required to figure that out with
any certainty isn't fast. It's also something of a research area AFAIK,
since very few languages have the sort of loose, late-binding (and that's
late as in "Waiting for Godot" late...) characteristics of perl. The ones
that do don't have much literature dedicated towards generating optimizing
compilers, at least not that I've found)
>Is there an entry point between this
>line and $thing's last use as an l-value, and can the expression
>that is getting assigned there be seen to clearly be a reference?
>
>Do we even care?
>
>if symbolic reference only gets fallen back to when, oops, something
>that is not a reference gets used as one, what exactly do we save? The
>check to verify that something is in fact a reference?
It hoses optimization. What do you do, for example, if symbolic references
like that end up replacing functions in the symbol table? (Kiss inlining
good bye) Or they add in new methods? (Shoot your method cache) Or just add
in new variables? (Which makes compile time validation of variable
interpolation in strings, or "used only once" errors, kinda wrong)
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk