Typing system vs. Java

Markus Schaber markus at schabi.de
Fri Aug 10 19:54:43 EDT 2001


Hi,

Bengt Richter <bokr at accessone.com> schrub:

> E.g., what if there were a 'restricted' keyword (or you pick one ;-)
> which allowed the compiler to assume that a function's arguments would
> always be the same types as in provided default arguments, and that
> there would be no global side effects, and global references would be
> stable as to type? It would seem you could allocate local working
> storage on the stack and avoid reference counting and lookup to a
> large extent.

But you can't save the lookups between different objects of the same 
type, because "same type" means "same interface", not "same 
implementation".

And trickery with the reference counting may get you into problems when 
using multithreading. Assume, you don't increase the reference count 
for local variables - than another thread may kill the last counted 
reference, and the object is freed erreaneously.

I personally think that adding partial type-safety to Python doesn't 
make much sense, the language would just get inconsistent this way.

But I'd love a Python-like language (may be called Tython - tight 
Python) that includes and enforces full typing - maybe at the cost of 
some comfort and possible trickery.

Then we could decide which language to use depending on the task we 
have to fulfil.

markus
-- 
1) Customers cause problems.
2) Marketing is trying to create more customers.
Therefore:
3) Marketing is evil.  (Grand Edwards in comp.lang.python)



More information about the Python-list mailing list