Genus |
Genus is an object-oriented language that aims to provide an expressive, lightweight genericity mechanism with better code reuse than Java and stronger static checking.
The core idea of Genus is to add constraints that are predicates describing features of types that are required by generic code and models that show how types can satisfy constraints. To make the mechanism lightweight, types induce natural models for constraints when the operations of the type already match what the constraint requires. In typical use, models do not need to be defined or mentioned, yet the expressive power to provide a customized model is always present. Genus integrates this mechanism with object-oriented inheritance so that models can be later enriched in a modular way to handle future subclasses. It supports powerful reified existential types that enable constraints to act as a generalization of interfaces.
The implementation of Genus is largely complete. The type checker has been implemented; the back-end translator to Java handles most features of Genus; we are still finishing some aspects of the implementation of reified existentials. We plan to release the compiler publicly when the implementation is more complete.