Are there any proposals for Tuples?

Mark S. Miller erights at google.com
Wed Apr 10 19:00:05 PDT 2013


On Wed, Apr 10, 2013 at 6:48 PM, Brendan Eich <brendan at mozilla.com> wrote:

> Yeah, I wrote http://brendaneich.com/2011/**01/harmony-of-my-dreams/<http://brendaneich.com/2011/01/harmony-of-my-dreams/>which included tuples, but after an initially warm reception, TC39 settled
> down to more incemental moves, and binary data emerged.
>
> We've been thinking along the following lines since then, apologies for
> brevity:
>
> With new Uint32Array(4) you get a reference type instance. Just as with
> typed arrays today, but same goes for structs as for arrays.
>
> With Uint32Array(4) -- note lack of 'new' oeprator -- you would get an
> immutable value type, which could be stack allocated if escape analysis
> allows. This is for the VM to worry about. It's the JS way.
>

I like where this is going. But how did the array returned by
Uint32Array(4) get initialized?

Could these be the same as the ParallelArrays used by rivertrail? They can
be safely shared between workers for the same reason they can be safely
shared between threads within an event loop.



>
> /be
>
> David Bruant wrote:
>
>> Le 03/04/2013 17:54, BelleveInvis a écrit :
>>
>>> I mean, a stack-allocated, immutable, simple, value type, for
>>> high-performance uses.
>>>
>> I think binary data [1] is very close to what you're looking for.
>> "stack-allocated" is complicated to ask. It really depends on what the JS
>> "interpreters" decides to do with your variable and I don't think having a
>> construct to express "put that on the stack" would be appropriate for such
>> a high-level language.
>>
>> David
>>
>> [1] wiki.ecmascript.org/doku.php?**id=harmony:binary_data<http://wiki.ecmascript.org/doku.php?id=harmony:binary_data>
>> ______________________________**_________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss>
>>
> ______________________________**_________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss>
>



-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130410/6b962757/attachment.html>


More information about the es-discuss mailing list