Proposal: Class Templates

Isiah Meadows isiahmeadows at gmail.com
Wed Jan 16 09:56:46 UTC 2019


Also, it's worth mentioning Julia exists as language precedent here: it's
got generic runtime types in the form of both classes and type aliases,
despite being a dynamically typed, JIT-compiled language.
On Wed, Jan 16, 2019 at 04:54 Isiah Meadows <isiahmeadows at gmail.com> wrote:

> Reflection would be nice, but that's about the only use case I can think
> of. Being able to tell a typed number array from a typed object array would
> be useful for some array processing optimizations and maybe stream
> processing optimization, but that's about it AFAIK.
> On Wed, Jan 16, 2019 at 04:42 Claude Pache <claude.pache at gmail.com> wrote:
>
>> From what I understand (that is, not much), class templates are useful in
>> strongly typed languages, so that one can have a family of classes that
>> share the same implementation but that derive from different types; e.g.
>> Stack<int> for stacks of ints and Stack<string> for stacks of strings. In
>> JS, you can have one Stack class that accepts both ints and strings, so
>> that this use case doesn’t apply (or, at least, it is not a necessity).
>>
>> But I'm sure there are other use cases. What are they, and are they
>> compelling enough?
>>
>> —Claude
>>
>> Le 15 janv. 2019 à 19:59, IdkGoodName Vilius <viliuskubilius416 at gmail.com>
>> a écrit :
>>
>> See:
>> https://github.com/CreatorVilius/ecmascript-proposals/blob/master/proposal-class-templates.md
>>
>>
>> I think having Class Templates in JavaScript would be awesome thing and
>> should be implemented. But that’s just my opinion.
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190116/74d4ddbc/attachment.html>


More information about the es-discuss mailing list