From M.Faassen@vet.uu.nl Mon Jan 18 16:49:21 1999 From: M.Faassen@vet.uu.nl (Martijn Faassen) Date: Mon, 18 Jan 1999 17:49:21 +0100 Subject: [Types-sig] Re: Strongly-Typed Python References: <36A288F9.656E89ED@pretium.com> Message-ID: <36A36611.2C9B97CC@pop.vet.uu.nl> Evan Simpson wrote: [discussion/wishlist for Python based lower level language snipped] Hey, I've had some of the same ideas. I think Tim Peters or someone else once called this idea (if I'm right) 'SPython', for 'static Python'. Static Python would *not* be Python proper, it'd be a seperate but related language. I'll add one point to the wishlist. It was already implied, but it's nice to spell it out: * SPython should seamlessly integrate with Python proper. Python code should be able to call SPython functions and methods seamlessly. The other way around is more debatable, but the easier the better, of course. SPython would be far less dynamic than Python, but it would be possible to do a relatively easy automatic translation of SPython code to efficient C code. SPython would also miss quite a bit of Python functionality. Added functionality would be some static typing. Let's list a miss (as opposed to wish) list for SPython: * Sequences are arrays of basic (C) types in SPython. They cannot contain objects of a mixed type (no [1, "2", 3.0]), unless they're all Python objects. * SPython dictionaries are only indexable by string. * class instances are constructed once and cannot be modified on the fly. The structure of a class instance is determined by all assignments to 'self.' in the class definition (no matter if parts of that code are actually never reached). Assignment of incompatible types to the same variable is an error. If we have Static Python, some of the need for static typing in Python proper goes away. We tend to talk about how static typing in Python proper allows us to optimize more, but Static Python would allow far more optimization still, and it'd be far more easy as it's less dynamic. The other reason for seperate typing is more robust/easy (possible compile time) checking of function/method arguments, for large scale projects. Interfaces might work for this. Since this discussion probably also belongs on the types-sig, I'm sending a copy there too. Regards, Martijn