Traits - current state of discussion
Mark S. Miller
erights at google.com
Fri Sep 21 06:29:43 PDT 2012
The traits.js library is in great shape <http://traitsjs.org>. The traits
semantics it implements is wonderful <
http://soft.vub.ac.be/Publications/2011/vub-soft-tr-11-15.pdf>, 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 aron-homberg.de> 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. 
> 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." 
>  http://wiki.ecmascript.org/doku.php?id=strawman:traits_semantics
>  http://code.google.com/p/traceur-compiler/wiki/LanguageFeatures#Traits
> Thank you and kind regards,
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss