Splash has a unique type system: Instance variables ("slots") are types. Composite types allow multiple types to be grouped together into a value. Generic functions are dispatched over all subtypes of a composite type.
Values are data, and like all data on a digital computer, are stored as bytes. Adding a type tag to the bytes gives them meaning, both to the computer and the programmer. All values in Splash have a type.
A number of primitive types exist, including Integer, String, Array, and PrimFn. These store data in a system-defined manner, the bits of which are not exposed inside the VM.
References are exposed as the Slot metatype. Instances of Slot are types defining one slot containing a reference to an object. Slots are values and not just string identifiers, so they can carry extra information. The Slot instance contains information such as the string name of the slot, default value, and any restrictions on objects that may be placed in it. Because these are stored in the type, and not in the instance, space is saved over duplicating the instance variable names in each object, as happens in most dynamic languages. Slots represent the has-a relation in traditional object-oriented programming. For example, (slot (named "color")) can be thought of as the type "has-a color".
Since most values reqire more than one instance variable, the above is next to useless without a way to combine types together. This is where Compositional Typing comes in. Instances of the Composite metatype are types that bundle together multiple types into one value. Composite instances are themselves of a composite type, containing Slots direct_types, an array of the directly included types; all_types, an array of the flattened type tree; and size, holding an integer of the total size of instances of the composite for easy access.
Composite types can be considered instances of all their components. Multimethod dispatch tries functions defined for the composite type, then the types in all_types, in order.
TODO: rules for make, duplication, how to update