There is almost no speed hit the second time you create an instance of "Foo" with "Commonly", "Applied", and "Traits" applied. Not sure this would be useful for Java, although we can achieve the same effect as in the article.)
FWIW, this is all done in "user space". The metaclass instance is attached to every instance that it creates. When all the instances go away, there are no more references to the metaclass, and it gets reclaimed. The destructor handles deleting the symbol table entries that were added, and that's that.
There is something to be said for not baking things into the language.
(The caching is for the very common case of creating a subclass with optional roles applied:
There is almost no speed hit the second time you create an instance of "Foo" with "Commonly", "Applied", and "Traits" applied. Not sure this would be useful for Java, although we can achieve the same effect as in the article.)