Python from Wise Guy's Viewpoint
Pascal Costanza
costanza at web.de
Tue Oct 28 17:32:06 EST 2003
Andreas Rossberg wrote:
> The design of a type system is by no means canonical. In fact, it is
> based on set of pragmatic decisions and trade-offs. Idealized, you start
> with the trivial type system, which has only one type. Then you refine
> it incrementally by distinguishing certain classes of values through
> introduction of new types and typing rules. Introduction of typing rules
> is based on the following criteria:
>
> - Do they catch a lot of errors?
> - Are these errors serious?
> - Are they hard to localize otherwise?
> - Does the refinement rule out useful constructions?
> - Are such constructions common?
> - Are they expressible by other means?
> - Are the rules intuitive?
> - Do they interact nicely with other rules?
>
> And probably more. There are never any definite answers to any of these
> questions. The trade-off depends on many factors, such as the problem
> domain the language is used for. Usually the line is drawn based on
> experience with other languages and known problem domains. In the case
> of arbitrary recursive types, experience with languages that allowed
> them has clearly shown that it caused much more grief than joy.
Hmm, could a kind of "meta type system protocol" be feasible? I.e., a
language environment in which you could tweak the type system to your
concrete needs, without having to change the language completely?
Pascal
More information about the Python-list
mailing list