Optional argument types

Alex Russell slightlyoff at google.com
Tue Sep 25 08:03:48 PDT 2012


It's far too early to tell. I strongly prefer structural, but again,
backing a type system into ES isn't something to do lightly. It has huge
consequences that extend well beyond the grammar changes.


On Tue, Sep 25, 2012 at 3:59 PM, Andrea Giammarchi <
andrea.giammarchi at gmail.com> wrote:

> then nominal will be? :)
>
>
> On Tue, Sep 25, 2012 at 3:37 PM, Andreas Rossberg <rossberg at google.com>wrote:
>
>> On 25 September 2012 15:31, Andrea Giammarchi
>> <andrea.giammarchi at gmail.com> 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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120925/a2103446/attachment.html>


More information about the es-discuss mailing list