Python compilers?

Carl Banks imbosol at aerojockey.invalid
Thu May 20 23:03:51 EDT 2004


Paul Rubin wrote:
> 
> 
> Carl Banks <imbosol at aerojockey.invalid> writes:
>> > The example above kills any attempt to turn a.bar() into a static
>> > procedure call.
>> 
>> Of course it does--but it's one method.  A compiler, if it's good,
>> would only make the optization on methods named "bar", and it could
>> probably pare the number of possible classes it could happen to down
>> to only a few.
> 
> How could it possibly know?  The reassignment of a.bar could happen
> anytime, anywhere in the code.  Maybe even in an eval.

And if it happens anytime, anywhere in the code, the compiler will see
it and create more general code.  Or is that impossible?

As for eval, well it would be silly to even allow eval in a compiled
program; kind of defeats the purpose of compling.  You might let it
run in its own namespace so it can only affect certain objects.


-- 
CARL BANKS                      http://www.aerojockey.com/software
"If you believe in yourself, drink your school, stay on drugs, and
don't do milk, you can get work." 
          -- Parody of Mr. T from a Robert Smigel Cartoon



More information about the Python-list mailing list