I am trying to write a simple language for structures (simple data classes) because I use these often. Each structure has a name and a list of property declarations. For each structure two types are created: an interface and a class. I would like to use these types and their methods in other code. Unfortunately I can't seem to wrap my head around how types are defined and used.
Can somebody give me some pointers on:
- how to specify that a structure concept introduces two types, an interface and a class, in the type system?
- how to specify the methods of the interface and the class?