commutative (i.e. given traits A and B, A + B is equivalent to B + A) and associative (i.e. given traits A, B, and C, (A + B) + C is equivalent to A + (B + C)). Limitations While traits offer significant advantages over many alternatives, they do have their own limitations. Required methods If a trait requires the consuming class to provide certain methods, the trait cannot know if those methods are semantically equivalent to the trait's needs. For some dynamic languages, such as Perl, the required method can only be identified by a method name, not a full method signature, making it harder to guarantee that the required method is appropriate. Excluding methods If a method is excluded from a trait, that method becomes a 'required' method for the trait because the trait's other methods might call it. Supported languages Traits come originally from the programming language Self and are supported by the following programming languages: AmbientTalk: Combines the properties of Self traits (object-based multiple inheritance) and Smalltalk's Squeak traits (requiring explicit composition of traits by the programmer). It builds on the research on stateful and freezable traits to enable state within traits, which was not allowed in the first definitions. C#: Since version 8.0, C# has support for default interface methods, which have some properties of traits. C++: Used in Standard Template Library and the C++ standard library to support generic container classes and in the Boost TypeTraits library. Curl: Abstract classes as mixins permit method implementations and thus constitute traits by another name. D: Since version 2.003, the __traits language extension and std.traits module helper templates provide compile-time traits. Together with other language features (notably templates and mixins), they allow flexible automatic generation of methods based on interfaces and types. D also allows explicit aliasing of member methods and variables, including forwarding to multiple member classes. Fortress Groovy: Since version 2.3 Haskell: In Haskell, Traits are known as Type classes. Haxe: Since version 2.4.0. Called Static Extension in the manual, it uses using keyword Java: Since version 8, Java has support for default methods, which have some properties of traits. JavaScript: Traits can be implemented via functions and delegations or through libraries that provide traits. Julia: Several packages implement traits, e.g., Kotlin: Traits have been called interfaces since M12. Lasso OCaml: Traits can be implemented using a variety of language features: module and module type