Adding static typing to Python

Bengt Richter bokr at oz.net
Tue Feb 19 20:14:33 EST 2002


On Tue, 19 Feb 2002 16:37:23 GMT, Courageous <jkraska at san.rr.com> wrote:

>
>>Thanks for the link. Reading it makes me wonder if some sort of partial
>>static typing would be beneficial, e.g. if the compiler was able to
>>determine up front that X is an atomic ...
>
>That's everyone's first thought, however in the generation of
>a compiler, several other first steps are necessary to achieve
>performance; these steps can be achieved without static typing
>or even compiler hints. While optional static declarations are
>high on the list of things that can increase performance in a
>compiled python executible, there are things which are higher
>and have nevertheless not been done. That they haven't means in
>my mind that we should stop, and not add (optional) static typing
>until and unless they have. Because right now it would be mostly
>linguistic masturbation and not really help anything at all.
>
>If you're thinking that the compiler folks haven't made any
>progress because strictly there's no static type system, you'd
>be wrong.
>
I'm wondering whether at any point the interpreter has been instrumented
to count symbol bindings in terms what types they bind to at first
and how often they get rebound to a different type vs the same type?
For locals, globals, attributes, (now) slots, and maybe dictionary
key:value bindings in general?

It would be an interesting measure of how dynamic things really are
in practice.

Regards,
Bengt Richter




More information about the Python-list mailing list