[w3ctag/design-reviews] Record and Tuple ECMAScript Proposal (#518)

Hello TAG!

I'm requesting a TAG review of [Record & Tuple](https://github.com/tc39/proposal-record-tuple).

This proposal introduces two new deeply immutable data structures to JavaScript:

- `Record`, a deeply immutable Object-like structure `#{ x: 1, y: 2 }`
- `Tuple`, a deeply immutable Array-like structure `#[1, 2, 3, 4]`

Records and Tuples can only contain primitives and other Records and Tuples. You could think of Records and Tuples as "compound primitives". By being thoroughly based on primitives, not objects, Records and Tuples are deeply immutable.

Records and Tuples support comfortable idioms for construction, manipulation and use, similar working with objects and Arrays. They are compared deeply by their contents, rather than by their shallow identity.

JavaScript engines may perform certain optimizations on construction, manipulation and comparison of Records and Tuples, analogous to the way Strings are often implemented in JS engines. (It should be understood, these optimizations are not guaranteed.)

Records and Tuples aim to be usable and understood with external typesystem supersets such as TypeScript or Flow.

  - Explainer¹ (minimally containing user needs and example code): https://github.com/tc39/proposal-record-tuple/blob/master/README.md

  - Security and Privacy self-review²: The answer to all questions is "does not apply" - there is no known security-related issues so far with this proposal as this proposal does not expose any observable lifetime of those structures 
  - GitHub repo (if you prefer feedback filed there): https://github.com/tc39/proposal-record-tuple

  - Primary contacts (and their relationship to the specification):
      - Rick Button (@rickbutton), author & co-champion, @bloomberg
      - Robin Ricard (@rricard), author & co-champion, @bloomberg
      - Daniel Ehrenberg (@littledan), advisor, @igalia
      - Robert Palmer (@robpalme), Bloomberg/TC39 standards coordinator @bloomberg
  - Organization/project driving the design: @bloomberg
  - External status/issue trackers for this feature (publicly visible, e.g. Chrome Status): None

Further details:

  - [x] I have reviewed the TAG's [API Design Principles](https://w3ctag.github.io/design-principles/)
  - The group where the incubation/design work on this is being done (or is intended to be done in the future): @tc39
  - The group where standardization of this work is intended to be done ("unknown" if not known): @tc39
  - Existing major pieces of multi-stakeholder review or discussion of this design: [TC39 Stage 1 consensus in October 2019](https://github.com/tc39/notes/blob/master/meetings/2019-10/october-1.md#records--tuples-for-stage-1); planning to ask for Stage 2 in July
  - Major unresolved issues with or opposition to this design: 
    - JS developers seem excited about Records and Tuples; haven't heard widespread opposition overall
    - Should Record wrapper objects have a null prototype? [#71](https://github.com/tc39/proposal-record-tuple/issues/71). (Current proposal: yes)
    - How should ===  on Records and Tuples behave with floating point [#65](https://github.com/tc39/proposal-record-tuple/issues/65) (Current proposal: Records and Tuples are ==/=== if their contents are completely identical)
    - How can Records and Tuples point to objects? (Current proposal: to start, rely on solutions in JS; considering various approaches in a follow-on proposal <point to FAQ entry>)
    - How can entries in Records and Tuples be updated (Current proposal: See idioms in <FAQ entry>, potential follow-on proposal for deep updates https://github.com/rickbutton/proposal-record-deep-spread in development)
    - Minor: Name clashes with [ECMA262](https://github.com/tc39/proposal-record-tuple/issues/96) and [WebIDL](https://github.com/tc39/proposal-record-tuple/issues/116) internal concepts of "record" (Current proposal: rename the ECMA262 and WebIDL concepts)
  - This work is being funded by: @bloomberg

You should also know that...

We are interested where you would think that Record and Tuple would be a good fit for Web APIs and what work and/or precisions you'd need from us to use it. Please note that at the moment we do not have a way to create something analoguous to classes in that proposal. THis is being considered as a potential follow-on proposal.

We'd prefer the TAG provide feedback as:

  🐛 [open issues in our GitHub repo](https://github.com/tc39/proposal-record-tuple/issues) for **each point of feedback**


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/518

Received on Thursday, 28 May 2020 17:23:31 UTC