python improvements (Was: Re: New Language)

Michael Hudson mwh21 at cam.ac.uk
Sat May 13 09:22:10 EDT 2000


Moshe Zadka <moshez at math.huji.ac.il> writes:

> On 12 May 2000, Neel Krishnaswami wrote:
> 
> > If you can declare that a variable is a machine integer or float, and
> > arrays of the same, you have enough information to get about 80% of
> > the speed benefit that static typing can win you.
> 
> What about array-based member lookup, vs. dict-based? I.e., if we can
> optimize foo.bar to be either a 1) compile-time error or 2) an index to
> the member array, it will speed up quite a lot of code.

I've thought a bit about this; I reckon it's possible to do this for
"self" attributes inside class methods.  It gets harder in the
presence of inheritance, but I think it could be done.  After all, in
class methods you know that the type of "self" is...

Doing it for external accesses would be harder, methinks.  Another
idea I might play with in some of that copious free time...

Cheers,
M.

-- 
  languages shape the way we think, or don't.
                                      -- Erik Naggum, comp.lang.lisp



More information about the Python-list mailing list