From: Konrad H. <hi...@cn...> - 2001-09-08 22:11:00
|
> check each of those elements every time something is done on them. In > principle, if the Python VM knew that A was an array of Floats, it would > know that A[i,j,k] was a Float, and it would not have to do a check. I Right, but that would only work for types that are specially treated by the interpreter. Just knowing that all elements are of the same type is not enough. In fact, the VM does not do any check, it just looks up type-specific pointers and calls the relevant functions. The other question is how much effort the Python developers would be willing to spend on this, it looks like a very big job to me, in fact a reimplementation of the interpreter. > when this is called, the function bound to the "fun" name is passed to > map, as is the array bound to the name "A". The Array is known to be > homogeous. map could conceivably compile a version of fun that worked on Yes, that could be done, provided there is also a means for compiling type-specific versions of a function. > I know this is a major programming effort, and will, at best, be years > away, but I'd like to see Python move in a direction that makes it > easier to do, and allows small steps to be done at a time. I think > introducing the concept of a homogenous sequence could help a lot of I'd say that adding this feature is much less work than doing even the slightest bit of optimization. I know I am sounding pessimistic here, but, well, I am... Konrad. -- -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hi...@cn... Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- |