Roles in Raku take on the function of "interfaces" in Java, "mixins" in Ruby, and "traits" in the Smalltalk variant Squeak. These are much like classes, but they provide a safer composition mechanism. These are used to perform composition when used with classes rather than adding to their inheritance chain. Roles define nominal types; they provide semantic names for collections of behavior and state. The fundamental difference between a role and a class is that classes can be instantiated; roles are not.