Convergence and unification of composite types: Tuples, Arrays, Classes, Interfaces and Modules
Opened this issue · 0 comments
I hope this is the right forum to post about Verse. Also I am not an expert in PLT but a enthusiast.
Here are some thoughts.
Tuples, Arrays, lasses, interfaces and modules are essentially the same. The are composite types. Therefore since Verse is taking and innovative route, I think it is just better to call them all type.
Types and their elements can have names associated with them. The elements can be heterogeneous or not. E.g.
- Array/List - unnamed non computed non singleton homogenous map from the domain of the indices to the value, with unnamed elements
- Tuple - unnamed non computed non singleton heterogeneous map from the domain of the indices and/or symbols to the value, with unnamed elements
- Class - named non computed non singleton heterogeneous map from the domain of the symbols to the value, with named elements
- Module - named non computed singleton heterogeneous map from the domain of the symbols to the value, with named elements
Interface can be a class with additional restrictions. Believe additional restrictions can be achieved though decorator.
Similarly access modifications and constness. Everything can be public by default. E.g. @READ(this- | (B+ & C)) @wrire(this+) where + - can mean sub or super types.
Also declaration and inheritance is a form of type compositions. There should be a composition system to compose more composite types from composed types which are:
- names | unnamed type, names | unnamed field, common | instances level fields, homogeneous | heterogeneous of fields
Type composition operations will create new composite types sub or super typing relationships where the names and unnamed status can change but the shapes will be a sub or super shame. This will encompass inheritance without construction. The constructor order and composition can be defined through functional composition.
Named will always be a sub type of unnamed, e.g., a complete structural type can be a sub type to a nominative type and unnamed fields can be sub type to names fields of the same shape.
Also take typing to a new level, we can have type state like mechanism on which sub interface of the type can be called. E.g. an newly created file will start at the un opened state and need to be open before reading and will have to end in the closed state. Once open and before closing there can be multiple reads. Another would be after an instance of a type is created the constructors need to be called, and they can be only called once only. Finally the destructors need to be called if any to clean up held resources.
I originally posted this here: https://forums.unrealengine.com/t/convergence-and-unification-of-composite-types-tuples-arrays-classes-interfaces-and-modules/1229890