Each language implemented and called trait what you understood well. It is one of those things that nobody knows to define for sure.
So much trait as mixin are code reuse techniques, both make subclass, being that the first establishes a relation of subtype and the second not, although I have seen case that establishes, so I do not know if it ceased to be mixin.
The trait has no state, the mixin may have, but I’ve seen something called trait accepting state and other call mixin who does not accept.
If the mixin has been and does subtype what he is different from abstract class? Perhaps the fact that it does not allow a constructor, only the concrete class would have the constructor, the abstract class cannot be instantiated, but it can have constructors that obviously can only be called by the derived class. Maybe that’s what it is.
Some will say that putting only implementation and even having been is just an inclusion, which is a mechanism "underjudged".
What are the cases where we should use them? What are the development/maintenance problems these mechanisms proposes to solve?
It’s all about organization and reuse by solving the problems that other mechanisms have.
State inheritance, in particular, is complicated and deals with implementation detail, in addition to what is common for an object to have things to do in common with other objects, but not to be an inheritance as we normally know it. The trait solves this. What an object is able to do is different from it was derived from something.
Only implementation inheritance disorganizes the object to have a contract maintaining the implementation.
When you understand all the aspects of the mechanisms, you see that you can have an intersection of concepts, not everyone needs to be present, and when that happens you’re creating derivative mechanisms, so there are so many. It has language that preferred to have a very flexible "one" that allowed to make the derivations according to the use.
Dynamic typing languages can do mixin more easily, because it does not need the subtype to work, since the linking of the method to the object can be done at runtime, is often what the staff calls Duck Typing.
Trait is usually more interesting in static typing.
In other languages, there are other mechanisms that solve similar problems?
Yes, but not only do languages give these names to mechanisms that don’t always do this, they also do exactly or almost this with other names, or without giving a direct name to the mechanism (private inheritance, for example).
Of course interfaces and abstract classes are similar but not identical concepts. They also have the protolocos, delegations, policies, papers, concepts, type classes, just to stay in the ones I remember and know.
Completion
I’ve been studying this, but maybe because languages didn’t use them previously have little reliable information, and what you have is discrepant. But I know they are powerful mechanisms and should be used more.
I think it’s funny PHP have trait :) Interface too, class still goes.
Note that not everything is what you say it is:
Related: When to use inheritance, abstract class, interface or trait
– Wallace Maxters
Related: How to use Traits in PHP?
– Wallace Maxters
I think it’s kind of broad, even
less
mentions mixin: http://lesscss.org/features/#mixins-Feature– Renan Gomes
Related: What is the difference between mixins and inheritance?
– vinibrsl