Giter Club home page Giter Club logo

Comments (8)

littledan avatar littledan commented on May 22, 2024 3

I'd suggest that we call this "proposal-records-and-tuples", along the lines of this issue.

from proposal-record-tuple.

littledan avatar littledan commented on May 22, 2024 2

Yes, Record and Tuple are big new words we're introducing. So we will be defining these new, strong concepts. I just want to suggest that we minimize the number of words and concepts we introduce. If we want to use "immutable", then maybe we could use that consistently instead, like "ImmutableArray" and "ImmutableObject", though these terms have other issues. I think @BrendanEich made a good suggestion in 2011 to call these records and tuples.

from proposal-record-tuple.

littledan avatar littledan commented on May 22, 2024 1

@chicoxyzzy The use of the same term "value types" between these proposals is deliberate. The idea is that the records and tuples in this proposal would somehow form some of the basic precedents to define user-defined value types.

from proposal-record-tuple.

kleinfreund avatar kleinfreund commented on May 22, 2024

Both “record” and “tuple” are new terms in the JavaScript world. They were chosen somewhat arbitrarily, and don’t convey at all what the nature of this proposal is: Introducing a new kind of data structure to JavaScript that, on the surface, behave like the known collection type structures with the speciality that their contents cannot be changed.

By avoiding the terms “constant” and/or “immutable”, this becomes even more abstract and hard to see.

from proposal-record-tuple.

ljharb avatar ljharb commented on May 22, 2024

Both of those terms already have multiple competing meanings in JS, however, so i agree with the OP that these changes would make things clearer.

from proposal-record-tuple.

ljharb avatar ljharb commented on May 22, 2024

Indeed, "immutable" could mean any of:

  • "like a primitive" (you can set properties on them in sloppy mode, but they're discarded)
  • "like a shallow frozen object" (but its [[Prototype]] is mutable)
  • "like a deeply frozen object"
  • "like a deeply frozen object with internal slots or private fields that can't be modified" (which excludes regexes, promises, maps, sets, or Proxies which may not accurately react like this kind of object intuitively should)
  • "like a nonwritable property"
  • "like a nonwritable nonconfigurable property"
  • "like a const variable"

from proposal-record-tuple.

chicoxyzzy avatar chicoxyzzy commented on May 22, 2024

If we do want to introduce a term, let's choose one of the three (probably "value types"), and define it explicitly before using it.

In that case we have to make sure that "value types" term from this proposal doesn't conflict with Typed Objects' value types

from proposal-record-tuple.

rricard avatar rricard commented on May 22, 2024

Terminology should be good now

from proposal-record-tuple.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.