|
Henrik Lindberg, here are some general thoughts that I'd like to convey, just to verify that the approach I'm taking is what you'd expect.
All types can be described in terms of the new Object type described in PUP-5844. E.g. Numeric could be describe like this (in practice, it already exists, so this would be an error):
type Numeric inherits Scalar {
|
'from' => Numeric,
|
'to' => Numeric
|
'unbounded?' => Callable[{} >> Boolean]
|
}
|
PCore consists of the current basic types in the Puppet Type system. A serialized meta-schema will consist of such type instances, possibly with the addition of defined Object type instances.
Implementing PCore in PCore is all about describing all the PCore types as Object types. A serialized meta-meta schema consist of those Object types. It will, for instance, contain the Object type that describes the Object type.
The Object types for the classes in an RGen model can be dynamically generated since all features of each class are described in detail (with type information).
Other runtime implementations in Ruby, for which we want to share type information, will need to be associated with a handcrafted Object type since the type of their members is unknown but very likely something that we will want to specify.
All Object types must be added to a TypeImplementationRegistry and the TypeCalculator must consult this registry when it performs type inference (in essence, the fallback to Runtime('ruby', <some class>) must first consult the registry). We will need a global registry in combination with registries local to a ModelSet. The TypeCalculator must hence be ModelSet aware (this might be a challenge, given the somewhat global nature of it).
|