If you're looking to go lower (systems) level, or even if you're not, rust is worth checking out then too. It's the best experience I've had letting you require only the interface that does what you need, and it's also great at letting you make a type "from" something. e.g. you could require something be a HashMap, or merely that it can be converted `Into` a HashMap (a free action if it's already a HashMap).