On 25 September 2012 15:31, Andrea Giammarchi <[email protected]> wrote: > That's a hell of a question ... shapes speaking I'd say structural, since > AFAIK shapes are those boosted up more, isn't it? > > That would solve String VS string and Array VS Arguments which is, I > believe, kinda desired. > > Which one would you chose ?
I assume that most people would probably prefer structural types in principle, but the problem is that they induce far, far more expensive runtime checking (easily an order of magnitude). Which is why guards and trademarks were proposed as a more conservative, nominal mechanism. Generally speaking, retrofitting something type-like on an untyped language is a *very* hard problem. It has been tried with many languages and has succeeded for very, very few. You can read lots and lots of research papers on the subject. Fortunately, though, we have top-notch expertise on that topic on TC39, e.g. Sam TH. ;) /Andreas _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

