[Types-sig] Core Python.... (less is more)

Martijn Faassen faassen@vet.uu.nl
Thu, 20 Jul 2000 20:31:32 +0200


Hi all,

Jumping in.

Daniel Wang wrote:
> 
> Hmmm given the responses, I don't think I made myself all that clear...
> 
> Baiscally it boils down to the fact that adding any sort of typing
> discipline for what ever reason to "full Python" is going to be a very hard
> thing to do. So, I'm basically asking what's a small and interesting chunk
> of the language to tackle first.

Right -- that's basically the Swallow proposal (though it was originally
mostly concerned with optimisation (OPT), not so much with ERR or DOC).
I thought Paul Prescod did point this out to you.

A fully type-annotated strict subset of Python. I should know about
it, as I came up with the term 'Swallow'. :)

> From this small chunck one can very easily
> automatically define the appropiate runtime coercions so that when you cross
> over into the rest of Python there is an extra runtime check inserted at the
> right places.

There were some issues with this raised by Guido among others in the
previous wave of big discussion on this list. Some of the runtime checks
might become very expensive (for instance if a list is passed into the
Swallow part, and Swallow wants a list of strings, all the elements would
need to be checked). 

> Then the big picture is to slowly grow this chunck of typeable Python into
> more and more of the full language. Ideally the subset of typeable Python is
> really a subset of full Python, with perhaps an extra interface description
> file to prime the type inference system and to provide module level
> interface documentation.

Right, Swallow almost exactly. Um, sure, good idea! :)

Regards,

Martijn