Traits - current state of discussion

Mark S. Miller erights at
Fri Sep 21 06:29:43 PDT 2012

The traits.js library is in great shape <>. The traits
semantics it implements is wonderful <>, and has
been made precise. However, without platform support it suffers from,
arguably, four problems:
* performance -- as with the objects-as-closure pattern which it
generalizes, traits.js costs an allocation per method per instance.
* notation -- as a library, it lacks the syntactic affordances that similar
abstraction mechanisms, like the upcoming minimal classes, are expected to
* conflict detection -- it would be nice to catch unresolved conflicts
earlier than instantiation.
* impedance mismatch with classes.

The reason we've adopted the minimal classes proposal into ES6 is to adopt
only the agreed intersection of the various things people wanted classes to
do, leaving room to grow back into all sorts of missing functionality post
ES6. Traceur is an excellent vehicle to explore such extended classes
experiments. If you wish to try growing classes back towards supporting
traits, I suggest looking at

Note that none of these have been reworked to be consistent with the
current ES6 minimal classes design.

On Fri, Sep 21, 2012 at 8:19 AM, Aron Homberg <info at> wrote:

> Hi all,
> please excuse me if this post is misleading - I'm new to this mailing list.
> After implementing getter / setter methods (valid ES3 cross compile
> generator output) for classes in traceur-compiler
> I'm thinking about implementing traits. Therefore I'd like to know the
> current state of your discussions regarding how traits should look like. [1]
> Does the strawman/traits_semantics document reflect the recent common
> understanding how traits should be implemented?
> I'm asking because the Traceur wiki says: "Traits have been removed to
> pave way for a class proposal everyone can agree upon." [2]
> [1]
> [2]
> Thank you and kind regards,
> Aron
> _______________________________________________
> es-discuss mailing list
> es-discuss at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list