Dynamic features used

George Sakkis george.sakkis at gmail.com
Fri Nov 21 17:53:17 CET 2008

On Nov 21, 7:55 am, bearophileH... at lycos.com wrote:

> It's not easy to define what my point was :-) I try again, but the
> following questions don't cover all the points:
> - What are the dynamic features of Python that you use in your code?
> (excluding ones that can can be done with a good static template
> system).

Off the top of my head, getattr/setattr are the most frequent dynamic
features I use.

> - Are them worth the decrease in running speed?
> - Is it good for Python to become two languages in one, a fast
> statically typed one and a dynamically one, like pypy shows to like
> with RPython, or is it better to go the way of the Boo language, that
> (while being mostly static) is mixing dynamic and static typing in the
> same code, but that must rely on a very complex virtual machine to
> work?
> - Or maybe is it better to find other ways like CLips ones, that allow
> to mix dynamic and static features, generally keeping programs fast
> enough (Lisp-like syntax can lead to high performance too, as shown by
> the Stalin Scheme compilerhttp://en.wikipedia.org/wiki/Stalin_(Scheme_implementation)

Very valid points, and I also often think that dynamic typing is
overrated; most programs don't need to add or remove attributes at
will or change the class hierarchy. I don't know which of the
alternatives you mention would be better but I would welcome changes
towards the "static by default" direction, provided that (1) it *is*
still possible to write dynamic code if necessary and (2) the extra
effort in writing and reading it is not off-putting (e.g. no C++
template metaprogramming atrocities)


More information about the Python-list mailing list