[Types-sig] Back to basics

Greg Stein gstein@lyra.org
Wed, 22 Dec 1999 14:30:32 -0800 (PST)


This is all fine as long as the design does not preclude the availability
of typedecl information at runtime. Some of these discussions about new
namespaces or not worrying about names being defined could prevent that.

I've proposed plenty of syntax for the typedecls and interface
declarations. I don't think there has been a solid proposal yet for
parameterizations. I would recommend that the syntax design at least
starts with the proposal that I set up to save some work and provide a
basis for discussion about how to add parameterization.
[ personally: I'd recommend parameterization get punted to V2, although I
  worry that if we don't take its syntax into account, we might preclude
  its addition later on. ]

-g

On Wed, 22 Dec 1999, Paul Prescod wrote:
> I think that our version 1 is going to spin out of control if we spend
> too much energy trying to reverse engineer what Python code means in
> terms of a type system. Yes, I think that we can easily extract type
> declarations from 90% of all Python code. We will do that for version 2.
> Yes, I think that there are more sophisticated ways of doing data flow
> analysis, we may do that for version 3.
> 
> For version *1* we should going to require all declarations to be 100%
> explicit. We will allow out-of-line declarations in "shadow files" to
> allow the annotation of "old" Python and C modules. Inline declarations
> will be treated as Tim Peters suggests. They are identical in semantics
> to out-of-line declarations. Inline declarations should always be
> preceded by the "decl" keyword so that they can be easily stripped.
> 
> We can even write a small script that extracts them from Python code and
> generates an out-of-line file so that the semantics are clearly not
> context-dependent. In version 1 there is no automatic anything.
> 
> There will be two syntaxes for declaring types: interface declarations
> and compound typedecls. Both are parameterizable.
> 
> This should help us to answer (in the short term) many of the tricky
> questions that have been raised. "del foo" is merely illegal if it
> violates the declared interface of a module and is not otherwise. 
> 
> a=5
> a='abc'
> 
> is illegal if it violates the declared interface of a module and is not
> otherwise.
> 
> In version 2 and subsequent versions we can get to automatic type
> detection and maybe dataflow and type inferencing. But for version 1
> we've got to KISS if we're going to make progress.
> 
>  Paul Prescod

-- 
Greg Stein, http://www.lyra.org/