flowgrammable / steve-legacy

The Steve programming language
Apache License 2.0
4 stars 0 forks source link

Runtime dependent types #7

Open asutton opened 9 years ago

asutton commented 9 years ago

Related to #2, generalize the notion of runtime dependence. Instantiating a built-in type with an unknown value should generate a new dependent type. For example:

def X : record {
  n : int;
  a : int[n]; // or array(int, n)
};

Would cause all uses of a to also depend on n. I'm not sure if there is a general pattern that can be defined for this or if we need to define special cases for types that can be made dependent.

asutton commented 9 years ago

Initial support for runtime dependent types is provided at the AST level by the Dep_type. This represents a call to a function that returns a type.