Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convergence and unification of composite types: Tuples, Arrays, Classes, Interfaces and Modules #2

Open
sirinath opened this issue May 2, 2024 · 0 comments

Comments

@sirinath
Copy link

sirinath commented May 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant